I have an Access table with field1, field2, field3, field4 that have times like "13:41" or "1:34" or so on. I need to get the total amount of time for all of those fields.
Can I do this via SQL or is there somehow to do it in VB?
Are these datetimes?
if so you should be able to just sum the fields.
======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
DateTime types are stored as Doubles, where the Integer part is the days since Dec 30th 1899 and the fractional part is the fraction of a day since midnight.
[tt]myTime - Int(myTime)[/tt]
gives the fractional part of each value. Add these to get a total. Then
[tt]Int(myTotal) [/tt]
gives the days in the total and
[tt]Format(myTotal,"hh:mm:ss") [/tt]
will give the hours, minutes and seconds in your total.
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first
'If we're supposed to work in Hex, why have we only got A fingers?'
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.