Convert time of different lengths

L

Lawlee

Hi there,

Is it possible to convert time that are in long integer format eg.
92003 and 153504 to time format hh:mm:ss AM/PM. The problem is that the
data in the field are not the same length. Some of the time are 5
numbers and 6 numbers. The ones with 5 numbers has the 0 missing in
front eg. 084102 should display 08:41:02AM and the 6 numbers 145009
should display 02:50:09.

How can this be done?

Thank you
Lawlee
 
V

Van T. Dinh

?Format(TimeSerial(92003\10000, (92003 Mod 10000)\100, 92003 Mod 100),
"HH:nn:ss AM/PM")
09:20:03 AM

?Format(TimeSerial(153504\10000, (153504 Mod 10000)\100, 153504 Mod 100),
"HH:nn:ss AM/PM")
03:35:04 PM
 

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

Top