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

Calculate Time

Status
Not open for further replies.

Sussex

MIS
Nov 13, 2001
12
US
I have a database with 6 time fields T1,T2,etc. How can I get the minutes between t1-t2,t2-t3, etc and then average them for a specified date or date range.I do have multiple times foor any given day This has been driving me crazy and I know the answer is right under my nose. Thanks
 
Dear sussex,

use the
DateDiff(interval as integer, date1 as date , date2 as date[, firstdayofweek[, firstweekofyear]])

function to calculate.

In your case Interval would be "n"
dim minutesbetween as integer
minutesbetween =Datediff("n",ealierdate, laterdate)

if you change it to
minutesbetween =Datediff("n", laterdate,earlierdate)
the function will give back a negative value

regards Astrid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top