Convert Number to Time format

  • Thread starter Thread starter Krish
  • Start date Start date
K

Krish

In a Mutivalue database, time is stored as a number like "27108"
representing the number of seconds since midnight.I would like to convert
the number into Hrs:min in Access query using a formula. Any help is
appreciated.

Krish
 
If you are sure the number of seconds won't wrap past 24 hours, you could
use DateAdd() like this:
DateAdd("s", [Seconds], #0:00:00#)

This alternative gives a text result (not suitable for performing math on):
(Seconds] \ 60) \ 60 & Format(([Seconds] \ 60) Mod 60, "\:00")

Explanation of the integer division and Mod operator in:
Calculating elapsed time
at:
http://allenbrowne.com/casu-13.html
 
Back
Top