Somewhat new to access reporting. I need to compare two date/time stamps format [mm/dd/yyyy hh:mm:ss am], and return the total hours or minutes between the two dates. Is this possible, and if so what is the format? thanks for any help!
tuddys
"n" (in place of "h" will return the minutes.
It the times are GUARNTEED to be less that 24H, you can just use Format ((EndTim - StrtTime), "Short Time", as in:
Code:
EndTime = Now + 0.25
StrtTime = Now
LapsedTime = Format((EndTime - StrtTime), "Short time")
? LapsedTime
05:59
Note: the 0.25 represents 1/4 of a day or 6 hours. The 05:59 occurs as it took me a while to type the StrtTime = line.
To use this approach, you MUST be certain that the 'lapsedtime' will be less than one full day (24 Hours) - or check for that possability and adjust the results as necessary. the "Short time" format will ignore any full days! Consider the following:
Code:
ThisTime = Now
ThatTime = Now + 1.25
LapsedTime = Format((Thattime - thistime), "Short time")
? Lapsedtime
06:00
Here, I have essientially the SAME results even thpough the difference is one day more htan the previous example.
MichaelRed
m.red@att.net
There is never time to do it right but there is always time to do it over
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.