Subtraction and summation of time (hour and minute)

D

Duck

Can anybody help?
In the table, the activities duration has been stored in
HOUR/MINUTE format e.g. 00010226 =102 hour and 26 minute;
00001545 =15 hour and 45 minute, etc...
In generating query and form, how can I show in actual
time format (i) in hour and minute and (ii) do the
subtraction and summation for the time.
I.e. subtraction = 86 hour and 41 minute
And summation = 118 hour and 11 minute
Thank you....
 
L

Larry Linson

There is a Date/Time format, but that is for a point in time, and seems not
to be what you are using anyway. In what kind of field are you storing these
"special format" numbers? I would store them in Long Integers in the
smallest unit you are using, e.g., minutes, so for 102 hours and 26 minutes,
I would store 6146 minutes. That will simplify the calculation, and you can
calculate and format to show the result as you want.

lngHours = lngTime \ 60
lngMins = lngTime mod 60

Larry Linson
Microsoft Access MVP
 

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