Time function - elapsed hh:mm

  • Thread starter Thread starter Rolls
  • Start date Start date
R

Rolls

Two fields on a report contain a date-time stamp recorded by =now(). How to
display the elapsed time in hh:mm format in a third control?
 
Two fields on a report contain a date-time stamp recorded by =now(). How to
display the elapsed time in hh:mm format in a third control?

It depends somewhat on whether the time difference will ever exceed 24
hours. A robust way (that will display 192:30 for a week plus half an
hour):

DateDiff("h", [starttime], [endtime]) & ":" & Format(DateDiff("n",
[starttime], [endtime]) MOD 60, "00")

Note that it's "n" for miNutes - "m" is Months in both datediff and
Format expressions.
 
Back
Top