Date Format - "hh:nn" Doesn't Force Leading Zero

T

tbl

When I set a Date type field's format to "mm/dd/yyyy hh:nn",
the hours less than 10 are not showing the leading zero
(Access 2k).

To my old eyes, dates with times are easier to understand in
datasheet or continuous forms when all the segments line up,
instead of having a staggered look. But I'm not able to do
that, it seems.

Am I missing a basic point?
 
R

Rick Brandt

tbl said:
When I set a Date type field's format to "mm/dd/yyyy hh:nn",
the hours less than 10 are not showing the leading zero
(Access 2k).

To my old eyes, dates with times are easier to understand in
datasheet or continuous forms when all the segments line up,
instead of having a staggered look. But I'm not able to do
that, it seems.

Am I missing a basic point?

The format property will not produce leading zeros on the hour. The Format()
function will however if you are in a position to use that.
 
F

fredg

When I set a Date type field's format to "mm/dd/yyyy hh:nn",
the hours less than 10 are not showing the leading zero
(Access 2k).

To my old eyes, dates with times are easier to understand in
datasheet or continuous forms when all the segments line up,
instead of having a staggered look. But I'm not able to do
that, it seems.

Am I missing a basic point?


If it's just a matter of displaying the date/time in a report, format
the field in it's control source.
This appears to work for me.
Instead of [ADate]
write:
=Format([ADate],"mm/dd/yyyy hh:nn")

Make sure the Name of the control is NOT the same as the date field.

You can use the same expression in a form, as long as you don't need
to edit or input the date.

In a form, where you enter the data, how the field is displayed should
not be important, and of course, no one need ever 'see' the table.
 

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