How can I convert Labor Clock In Time to 12hr format

image

I am trying to convert the clock in time to a 12hr format. For example, on the second record, in my screenshot, 11.25 should equal 11:15 AM.

Any ideas?

Thanks!

A calculated field.

edit

A calc filed of type Datetime, with the expression

convert(datetime, Clockin/24)

converts it to a datetime. Then in the format of the displayed columns, select {time}

image

to give you:

image

4 Likes

There are fields on the LaborDtl table “DspClockInTime” and “DspClockOutTime” you could use as well.

2 Likes

@tse.dba - Just a warning… That is a datetime, so there is a date component as well. If you’re just displaying it, there’s no issue. But if you use it for calculations, then the date part might come into play.

Also worth noting that you can also use these methods in a Calculated Field

image

I looked at `IntToDateTime(), but it wasn’t obvious how to take decimal representation of hours to the the input that function needs.

The “hint” for IntToDateTime(x) is
image

Doesn’t exactly tell you what the expression represents. I guessed that it was in “days” (1 = 1 day after 1/1/1970 (or whatever the epoch date is), and that the fractional part of the date was the time (in fraction of a day).