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

DateDiff but returning TIME aswell

Status
Not open for further replies.

Steve95

MIS
Nov 3, 2004
265
US
Hi All

does anyone known how to a datediff on two datetime fields
so the returned value not only calculates the days but also the "h,n,s"

Thanks in Advance

Shin
 
You use different Interval Type Values in your datediff function to get each one back.

For example, to get days: datediff("d", {Table.Datefield1}, {Table.Datefield2}) would return the number of days. If you change the Interval Type to "h" you get hours, "n" is minutes and "s" is seconds. You then have to format and compbine them as text into the format string you want.

I hope that's what you were looking for???


If you wanted something to do it all in one pass, I don't know about that.




Chris
Data Intelligence Group
 
Cheers Chris appreicate your help..........

Many Many Thanks.....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top