Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Date and Time into hours and minutes

Status
Not open for further replies.

winds7

Technical User
Aug 8, 2008
5
US
I am trying to take a start date and time and a stop date and time subtract them (stop from start) can do this no problem BUT it comes out in decimal. I need it to come out in hours and minutes format in a table and a Query. I keep getting an operand error no matter what combination I use. Does someone know the correct string?
Thanks
 
Format([stop date]-[start date],'hh:nn')

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you I tried that and here is what I got:
Syntax Error (comma) in query expression '([stop date]-[start date], 'hh:nn') if I take out the comma I still get an error.
 
[!]Format[/!]([stop date]-[start date],'hh:nn')

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I am about to give up. Compile error. in query expression Format([stop date]-[start date],'Short Time') is what I am getting back. I know I picked short time in my table but I didn't pick that in my query I am actually building the expression in my query. I do greatly appreciate your help and patience! thanks
 
Any missing reference in your VBA project ?
When in VBE (Alt-F11): menu Tools -> References ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Are your fields actually named stop date and start date?

--Lilliabeth
 
no my actual string is this:
Elapsed Time: Format([Screening Stop]-[Screening Start], 'hh:nn') and it comes back with the compile error

Thanks for the FAQ links (PHV) I did go read them beings I am new to this. My boss told me about this site.
 
AFAIK "hh:nn" not 'hh:nn'
single quotes will not compile
 
Thank you to everyone who tried to help with my question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top