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

Access - Subtracting times in VBA 1

Status
Not open for further replies.

Wire216

Technical User
Feb 15, 2006
18
US
I'm trying to find the difference in minutes between two times, and store the result in an integer.

For example:

StartTime = 9:43:22 AM
EndTime = 9:47:17 AM

If I do EndTime - StartTime, I want to store the result (4) as an integer.

When a user presses the "start" button on my form, I assign the current time to a variable. When they press "finish," I store the current time, and try to find the total minutes between the two.

I have tried the DateDiff fuction but can't get it to return a result for minutes.

Thanks.
 
And what about this ?
DateDiff("n", StartTime, EndTime)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Alright, I feel stupid now. :)

Thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top