Duration as integer

D

Daan

Hi all,

I am using a database that is automatically filled in production. One of the
fields is called run_timed and represents a duration, but data is stored as
time/date (02:07:11 is 2 hours, 7 minutes and 11 seconds).
Since I want to sum durations in my query, I want to convert the entries in
this field to an integer. How do I do this?
 
A

Allen Browne

To convert the value into a long integer (whole number of seconds), create a
query, and type this into a fresh column in the Field row:
Seconds: DateDiff("s", #0:00#, [Field1])
replacing Field1 with your field name.

If you wanted to store the value in seconds, and then format it to show in
h:n:s, you could use this approach:
http://allenbrowne.com/casu-13.html
 
Top