Time To Minutes And Back Again

P

Peter

I use the following to calculate the amount of downtime

=Format([StopTime]-1-[StartTime],"Short Time")

this returns Hours & Minutes e.g "01:40"

how do I get this into minutes so I can sum the total downtime over a
period. I would then like to convert that total back to hours and minutes

thanks

Peter
 
J

Jeff Boyce

Peter

The Date/Time field in Access is NOT a duration data type. It stores
"point-in-time" data. Even if you Format([YourDateTimeField],...) to
something that LOOKS LIKE hours and minutes, you are still storing
point-in-time (i.e., date and time) data.

If you need to record a number of minutes, you'll need to use a numeric
field (I assume you need numeric because you'll want to be able to
add/subtract). You'll also need to build/use some "parsing" functions to
convert from one unit (e.g., 300 minutes) to another (e.g., "5 hrs.").
Check the mvps.org website to see if there are any, or try google.com under
the MS Access group.
 

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

Top