The amount of time (hrs/secs) between 2 times

T

teddyg

Anybody have code to determine the amount of time (in hours and minutes)
between 2 different Time settings?

In an application I have, I record the Time() a user logged on, and the
Time() they logged off, and wish to determine elapsed time they were logged
on.

I'd prefer to determine the elapsed time as part of query (where I have both
logon and logoff time pulled from a table), and want to pass the elapsed
time back to a form.

Thanks,

teddyg
 
G

Guest

Look in help for the function datediff, its give you the different between
date or time in houres minuts dats etc

datediff("n","11:00","17:00")
in minutes
 
V

Van T. Dinh

Use DateDiff() function to work out the elapsed time in seconds and then use
the integer division \ and modulus MOD operator to work out the whole hours
and seconds elapsed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top