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!

How to calculate Time diference between 2 Time Feilds 1

Status
Not open for further replies.

number2

Technical User
Oct 25, 2001
284
US
How can I calculate the time difference in hours and a 1/4 hour increment? I tried the DateDiff function with no luck.
 
Try this expression...

1 / (10 / (DateDiff("n", Date1, Date2) / 6))
 
Thanks, it almost works. I can get it to calculate the number of hours and the number of 1/4 hour units. I need to get it to round off to the nearest 1/4 hour. Any ideas?
 
You want it to return a date value? If so just use dateadd. example:where DateValue is your Start date...

dateadd("h", (1 / (10 / (DateDiff("n", Date1, Date2) / 6))), DateValue[/red])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top