Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Date format keep leading zero

3,202 views
Skip to first unread message

Karl H

unread,
Jan 10, 2009, 1:22:00 PM1/10/09
to
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

Rick Brandt

unread,
Jan 10, 2009, 1:43:04 PM1/10/09
to

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

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Karl H

unread,
Jan 10, 2009, 2:53:01 PM1/10/09
to
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!

Larry Linson

unread,
Jan 10, 2009, 9:35:15 PM1/10/09
to

"Karl H" <Ka...@discussions.microsoft.com> wrote

> 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

Marizel

unread,
Feb 17, 2009, 3:19:22 PM2/17/09
to
"Larry Linson" wrote:

> 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

0 new messages