Duration as integer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top