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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the syntax for datediff for date and time

Status
Not open for further replies.

Poobear1929

Technical User
May 11, 2004
32
US
I am trying to calculate time using datediff. However I want to know the hours to the tenth between two dates. The dates I have in my database are date and time together. example

Start
1/01/04 10:20:34
Stop
2/01/04 9:20:34

Now I want to know the time between the times. This example would be 23.0 hrs.

I just don't know the syntax for datediff to calculate this, or do I have to use a different function?

Thank you
 
Have you tried this ?
Format((DateStop - DateStart) * 24, "0.0")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top