Importing calculation time format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,

Im trying to import from excel where i have a column having cumulative time
calculations. something like 35:12:36 expressing 35 hours and 12 minutes
etc... the problem is that i cannot find this format in access. where access
automatically converts this time to date\time. any suggestions ?

Thank you All
 
There really is no such thing in Access. The Date/Time data type in Access
stores values as as IEEE 64-bit (8-byte) floating-point numbers. It
represents a point in time.
Duration, however, is a different animal. How you store it is up to you,
but using a Date/Time data type will not really work well. For example, if
you use your 35:12:36 example, and try to turn it into a date/time value
using the TimeSerial function:
=TimeSerial(35,12,36)
it will return 12/31/1899 11:12:36 AM

I would suggest carrying the duration as a Long data type representing the
number of seconds. Then write functions to transform the value from the text
format to the number and back again.
 
While I agree whole-hearted with Klatuu that you shouldn't use a Date
datatype for durations, I showed a kludge to get around the issue you're
describing in my October, 2003 "Access Answers" column in Pinnacle
Publication's "Smart Access". You can download the column (and sample
database) for free from http://www.accessmvp.com/DJSteele/SmartAccess.html
 
Back
Top