Provided that your times don't cross midnight:
dtElapsed = dtEnd - dtStart
If you use this approach, the result is expressed as a fraction of a
_day_, so you have to multiply it by 24 to get decimal hours or by
1440 to get decimal minutes.
If your clock times may cross midnight but the elapsed time is never
more than 24 hours, you can use:
dtElapsed = dtEnd - dtStart + IIF(dtEnd>dtStart,0,1)
If the elapsed time may be more than 24 hours, you have to keep track
of start and finish dates and times.
You can also use DateDiff, of course, with the appropriate qualifiers,
but I have never thought it worth the trouble for most time
calculations, since the simple approaches above work well in 99.8% of
applications
I know about the Diff Date function, it calculates the difference between dates. What will I use to calculate the difference between times? For example, a person was dispatched to a location for a delivery at 12:00PM and he departed at 2:00PM the total time is 2 hours. How do I do that ?
Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher