hours and minutes storing past midnight

R

Rivers

i have a query that sums up all hours and stores this as a main figure lets
for this question say

78:34

to store this in an access table i need to use a text type

but when i try and do 78:34-30:00 to give me 48:34 it gives me a message
saying invalid data type, now im guessin its due to it being saved as a
string but am an unable to find the correct data type in a table to store it
 
J

John W. Vinson

i have a query that sums up all hours and stores this as a main figure lets
for this question say

78:34

to store this in an access table i need to use a text type

but when i try and do 78:34-30:00 to give me 48:34 it gives me a message
saying invalid data type, now im guessin its due to it being saved as a
string but am an unable to find the correct data type in a table to store it

I'd suggest storing durations in a Long Integer field in minutes. You can
format it for display purposes with an expression like

[Duration] \ 60 & Format([Duration] MOD 60, "\:00")

Text fields, of course, cannot be added or subtracted, and even if they could
they would use base-10 arithmatic, not base-60 as is needed for times.


John W. Vinson [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

Similar Threads


Top