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

time difference and/or date difference

Status
Not open for further replies.

juniormint2009

Programmer
Joined
Mar 22, 2009
Messages
20
Location
US
Hi all, I need to calculcate the difference between 2 date fields, but need the time more than just the days. I tried the datdiff function but it gave me a whole number.
I have the following code below, and my date fields say:
"12/31/2008 9:24:47 AM" and "12/31/2008 12:52:24 PM"

DateDiff("h",[resolved_time],[open_time])
give me -3 when it should be 3.46.

Am I missing an argument ??
 
No that is the correct answer. 9:24 AM minus 12:52 PM equals -3 hours. since you are requesting the "h"ours minutes are ignored.
 
ok, I may have spoken too soon, I actually did this
Expr1: DateDiff("n",resolved_time,open_time)/60
now that gives me the amount of time it took in hours too resolved an issue, but the number is negative.
I plan to take the total of all these valuse and then averaget them, I am pretty sure I can do that with the avg function, but what about a mediun of that # ???
 
thanks Ray! I am using my above datediff argument with the 'n' option instead of h and then dividing by 60 which gives me my number like 19.27 (so I know it is 19.27 hours to resolve a problem) unless there is an easier way. But thanks for the reply! You guys are great and have helped me out tons!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top