Importing and changing times

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

Guest

I have an excel worksheet that is sent to me on a regular basis for analysis.
I do the analysis in Access. Both are from the Office 2000 product.

When the times are sent to the Excel database, they are sent as text in the
form 0123 (24 hr clock). I need to convert them to times that Access can
understand.

I can change them in Excel using the TIME command, but the command provides
different output in Access.

Any ideas?

Thanks.
 
If you can always assume the text for the time will be 4 characters, with the
left 2 digits being hour and the right 2 being minutes, this will do it:
xlTime = "0123"
MyTime = TimeSerial(Val(Left(xlTime,2)),Val(Right(xlTime,2)),0)
now, MyTime = 1:23:00 AM
 
Back
Top