Subtracting date and time

Carl_R

Registered User.
Local time
Tomorrow, 00:22
Joined
Aug 16, 2002
Messages
82
I've almost got this but seem to be a little stuck on the format part.

I am performing a simply date subtract in a query
Code:
Test: Format([OpenedDateTime]-1-[ClosedDateTime],"h,nn")

I am trying to format the result in hours and minutes - so 19/05/2008 09:10 - 21/05/2008 15:17 = 54:07

Any suggestions welcome.
 
You want to use DateDiff

DateDiff("n",[OpenedDateTime],[ClosedDateTime])

This will give it to you in minutes.
 
Perfect. I have used "h" to get the rounded hours
 

Users who are viewing this thread

Back
Top Bottom