Show all of digits of time

jgandino

Registered User.
Local time
Today, 22:02
Joined
Oct 4, 2004
Messages
11
I am having problem with access showing all four digits of my time with anything like 0900 or 0400. It doesn't show the first zero. Thanks.

Justin
 
Do you have the field defined as a Date\Time field? Is so, you need to make sure you have the format set as well. In this case you would want Short Time, but you need to remember Access will want the colon in there, or you will get an error. If you have the field merely defined as a numberic field, you can set the format to 0000, but I don't think you will be able to perform any time calculations on that that way.
 
jgandino said:
I am having problem with access showing all four digits of my time with anything like 0900 or 0400. It doesn't show the first zero. Thanks.

Justin

h Display the hour as a number without leading zeros (0 – 23).
Hh Display the hour as a number with leading zeros (00 – 23).
N Display the minute as a number without leading zeros (0 – 59).
Nn Display the minute as a number with leading zeros (00 – 59).

ie:

MyTime = Format(now(), "Hh") + ":" + Format(now(), "Nn")
 
Numbers in time

OUTSTANDING!!! Exactly what I was looking for. Thank you. :)
 
Odd

I've tried nearly everything and changing the suggested formats does not change the view of it to 0400, it still stays at 400. Any other suggestions? Thanks!
 
There ain't but three ways a time will be shown as 400 or 0400 or 2300 or whatever military time you are looking at.

One way is that you have an explicit format string that omits the colons for you when you display it.

The other way is that the time 0400 was stored in an integer or long field, in which case your data storage format doesn't directly support the output format you were trying to use. This is what Friday was telling you.

The third way is that the time was stored as a string "0400", but that is unlikely, 'cause Access wouldn't have dropped that leading zero in that case and you wouldn't be complaining.

Case 1, find the format string and modify it.

Case 2, fix the design of your table to store time in a date field, not an integer or long field. Then apply the format string suggested by yhgtbfk.

I doubt it is case 3.
 
Work with it tonight.

Alright, I am going to work with it again tonight and see if I can locate the problem. Thanks again.
 

Users who are viewing this thread

Back
Top Bottom