Total Time

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

Guest

I have a query with fields of Start Time and Stop Time and Total Time. What
expression do I use to get the Total Time to calculate the time between Start
and Stop to get the total time?
Thanks!
 
Depending on the units that you want to use to measure the time difference,
you would use the DateDiff () function.

DateDiff ("<units>", [Start Time], [Stop Time])

(I might have the times backwards) Check out the Access Help > Visual Basic
Language Reference > Functions > D-G > DateDiff for the <units> particulars.

BTW, it iis generally not a good idea to keep data that can be calculated in
a table. It is usually better to simply calculate it as needed.

Good Luck!
 
Sam,
You can use =DateDiff("n",[Starttime],[Returntime])/60 as the
control source for your [totaltime] text box on your form or report - this
returns the time in Hours and portion of an hour
IE, 1 hour and 30 minutes will be displayed as 1.5
- to limit the amount of numbers to 2 after the decimal point then use
=Format(DateDiff("n",[Starttime],[Stoptime])/60,"0.00")

Hope this helps
 
Yes, this one works!
Thanks!

Chris B via AccessMonster.com said:
Sam,
You can use =DateDiff("n",[Starttime],[Returntime])/60 as the
control source for your [totaltime] text box on your form or report - this
returns the time in Hours and portion of an hour
IE, 1 hour and 30 minutes will be displayed as 1.5
- to limit the amount of numbers to 2 after the decimal point then use
=Format(DateDiff("n",[Starttime],[Stoptime])/60,"0.00")

Hope this helps
I have a query with fields of Start Time and Stop Time and Total Time. What
expression do I use to get the Total Time to calculate the time between Start
and Stop to get the total time?
Thanks!
 

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