Date format keep leading zero

K

Karl H

Hi,
In a report, I would like to retain leading zeros for month and days.
I want "03/06/1999" instead of "3/6/1999"
Using an input mask of 00/00/0000;0; doesn't work.
The table, from which the data is drawn is keeping the shorter version
stored, even though the input mask for that data has the same input mask as
above.
Thank you,
Karl
 
R

Rick Brandt

Hi,
In a report, I would like to retain leading zeros for month and days. I
want "03/06/1999" instead of "3/6/1999" Using an input mask of
00/00/0000;0; doesn't work. The table, from which the data is drawn is
keeping the shorter version stored, even though the input mask for that
data has the same input mask as above.
Thank you,
Karl

Set the Format property of the TextBox on the report you are using to
display the field. Set THAT to "mm/dd/yyyy".
 
K

Karl H

I tried it first leaving the quotes on, and "mm/dd/yyyy" appeared on my
report, but removing the quotes does the trick. Thank you very much!
 
L

Larry Linson

Karl H said:
The table, from which the data is drawn is
keeping the shorter version stored, even
though the input mask for that data has the
same input mask as above.

No, you are wrong... a Date/Time Field (there's neither a Date Field or a
Time Field) _stores_ the date time in a double-precision format, where the
part to the left of the decimal represents days since 30 Dec. 1899 (can be
plus or minus), and the "fractional" part to the right of the decimal
represents seconds since midnight on that date.

What you are seeing is the default formatting of that data.

To get the data formatted as you wish, with lead zeroes for month and day,
you can use the format string "mm/dd/yyyy". Works for me.

Larry Linson
Microsoft Office Access MVP
 
M

Marizel

Larry Linson said:
To get the data formatted as you wish, with lead zeroes for month and day,
you can use the format string "mm/dd/yyyy". Works for me.

Larry Linson
Microsoft Office Access MVP

I've used "mm/dd/yyyy" fine in the past, but now our application is also
going to be used in Trinidad, where they use "dd/mm/yyyy" format. "Short
Date" will change that based on the system settings, but I was trying to see
if there was a way to have leading zeros and perhaps 2-digit years that would
still adjust between mm/dd and dd/mm. Anyone know if that's possible? (If
it were up to me, all date formats would be "yyyy/mm/dd"!)

Thanks,
Mary
 

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