Problem with formatting time in a report

  • Thread starter Thread starter T Best
  • Start date Start date
T

T Best

we're kinda stuck here in the stone age. we're still using Access 97.
this worked for me:

set the Format property of a text box to: mm/dd/yyyy hh:nn AM/PM
set the control source to: Now()

hope that helps
Ted
 
I'm trying to setup the Format property for a text control that displays a
Date/Time value and I can't get it to work the way I want. I want the
Date/Time to display the hours and minutes with two digits each (as in 09:15
AM). I try specifying mm/dd/yyyy hh:nn AMPM, but what happens is that Access
changes the AMPM to ampm (I don't know if this change has an effect on my
problem), and more importantly to me the hour keeps coming up with only one
digit. From reading the help I understood that "hh" would make the hour
portion of the Date/Time display with two digits. Does anybody know why this
is happening?

I am using Access 2002.
 
I'm getting the same thing in Access 2003 for the "hh". However, for the
AMPM part, the definition in the help file is:

AMPM - Twelve-hour clock with the appropriate morning/afternoon designator
as defined in the regional settings of Windows.

AM/PM - Twelve-hour clock with the uppercase letters "AM" or "PM", as
appropriate.

So, for the first one without the "/", while Access is changing it to a
small "ampm", it really doesn't matter because it will use what is in your
Regional settings. If you want to force upper or lower case use "AM/PM" or
"am/pm".

If I use the hh in a Format() function instead of in the Format property of
the textbox, I do get two digits, as expected.
 
Back
Top