Tecnologia

J

Jose Gonzalez

From: "CatQM" <[email protected]>
Subject: Time format: 0###
Date: Friday, January 18, 2008 10:10 AM

I have imported data into Access with 24 hr clock times (just numbers, no
formatting). My times before 1200 do not have a leading zero. For example
I have 300 instead of 0300. How can I add this needed zero in a query? --
Cat
 
P

pietlinden

From: "CatQM" <[email protected]>
Subject: Time format: 0###
Date: Friday, January 18, 2008 10:10 AM

I have imported data into Access with 24 hr clock times (just numbers, no
formatting). My times before 1200 do not have a leading zero. For example
I have 300 instead of 0300. How can I add this needed zero in a query? --
Cat

how about taking the left 2 characters if the length=4

Hour:Left$(strTextTime, len$(strTextTime)-2)
Minute: Right$(strTextTime,2)
 
K

Ken Sheridan

Set the Format property of the column in query design view to:

0000

Alternatively set the Format property of any control bound to the field in a
form or report to the same.

Ken Sheridan
Stafford, England
 

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