Time Format (1 Viewer)

thingssocomplex

Registered User.
Local time
Today, 04:19
Joined
Feb 9, 2009
Messages
178
Hi All,

I have a Excel Extract that outputs time in to text entered in 24hr format for example 1445, 1145 1830 and so on. When this is placed in to Access is there a SQL Query I can write to convert to time format so I can correctly calculate a duration? I have tried Format(CDate(MyField),"hh:mm") but this just shows 00:00!!!
 

JANR

Registered User.
Local time
Today, 05:19
Joined
Jan 21, 2009
Messages
1,623
How about

Format(Timeserial(Left([MyField],2), Mid([MyField],3,2),0), "hh:mm")

JR
 

thingssocomplex

Registered User.
Local time
Today, 04:19
Joined
Feb 9, 2009
Messages
178
Thank you very much, amazing did the trick :)
 

JANR

Registered User.
Local time
Today, 05:19
Joined
Jan 21, 2009
Messages
1,623
When you know what to look for it's easy :)

JR
 

Users who are viewing this thread

Top Bottom