Fractional Time: Function.

  • Thread starter Thread starter Graham Clements
  • Start date Start date
G

Graham Clements

On a monthly basis I receive billing information on CD
which needs to be input and analysed. One of the fields
is time but it is formatted as fractional time, ie 0 =
12am, 0.5 = 12pm, etc. I need a function to use within
access queries which can quickly and easily convert
between standard and fractional time, is there such a
function, if not how could I wright this using SQL? Or
maybe it would be easier to build a function???

Thanks for any help provided.

Graham
 
The Date/Time field in Access is stored as a number where the integer part
represents the date, and the fraction part the time of day. You could
therefore store the value into a date/time field, and it would work.

To demonstrate this, open the Immediate window (Ctrl+G) and enter:
? CDate(0.25)

Alternativley, you could multiply the fraction by 86400 (i.e.60 * 60 * 24),
and use DateAdd() the seconds:
? DateAdd("s", 86400 * 0.25, #0:00:00#)
 
Back
Top