How do i calculate the time from a number that represents seconds after midnight?

hardrock

Registered User.
Local time
Today, 12:59
Joined
Apr 5, 2007
Messages
166
Hi all, i wonder if you can help me out with a little problem. A table that stores order history on our ERP system at work stores the time as seconds past midnight. On that basis, in VBA code, how would i express the number 60915 as hh:mm:ss thanks.
 
How about:
Format("." & YourField,"hh:mm:ss")
 
hardrock,

Just add the seconds to the beginning of the the day's date:

Format(DateAdd("s", 60915, Date), "hh:mm:ss")

In a query:

NewField: Format(DateAdd("s", [TimeInSeconds], [YourDate]), "hh:mm:ss")

This assumes that [YourDate] is the date worked and is kept along with
the time.

hth,
Wayne
 

Users who are viewing this thread

Back
Top Bottom