If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Format Property bug: "hh" doesn't display leading zero
A number of closed topics deal with problems displaying military time
with various suggested solutions, but none of the discussions I have seen mention that the the underlying problem seems to be a bug in Access' Format Property. I was unable to find a discussion of this problem in the Microsoft Knowlege Base. Military time (and many scheduling and dispatching applications) always displays 24 hours with a leading zero for hours less than 10, e.g., "08/17/2006 05:35" Contrary to its documentation, the Microsoft Access Format Property does not display a leading zero for times with hours less than 10. Reference: Microsoft Access Help Topic: "Format Property - Date/Time Data Type". "hh Hour in two[sic] digits (00 to 23)." To demonstrate the issue: 1. Create a new blank database. 2. Create a new unbound form. 3. Add an unbound Text Box. 4. Set it's Format Property to "mm/dd/yyyy hh:nn". 5. Waste the next hour zorking around trying to get it to display military time for hours less than 10. (OK, go ahead and bind it to a Table Date/Time Field. Waste two hours. Fool with the Input Mask Property. Waste three hours.) This Format Property issue also applies to Reports, but can be kludged by crafting a calculated Control with the Control Source set to an expression calling the Format Function with the same format string (=Format([MyDateTime], "mm/dd/yyyy hh:nn")), which works as documented, but this technique is useless for Form data-entry Controls that need to display military time. |
#2
|
|||
|
|||
Format Property bug: "hh" doesn't display leading zero
|
#3
|
|||
|
|||
Format Property bug: "hh" doesn't display leading zero
|
#4
|
|||
|
|||
Format Property bug: "hh" doesn't display leading zero
Seems to work as documented for me. Tested in both Access 2003 and Access
2000. Here's the result ... http://brenreyn.brinkster.net/format.jpg -- Brendan Reynolds Access MVP wrote in message oups.com... A number of closed topics deal with problems displaying military time with various suggested solutions, but none of the discussions I have seen mention that the the underlying problem seems to be a bug in Access' Format Property. I was unable to find a discussion of this problem in the Microsoft Knowlege Base. Military time (and many scheduling and dispatching applications) always displays 24 hours with a leading zero for hours less than 10, e.g., "08/17/2006 05:35" Contrary to its documentation, the Microsoft Access Format Property does not display a leading zero for times with hours less than 10. Reference: Microsoft Access Help Topic: "Format Property - Date/Time Data Type". "hh Hour in two[sic] digits (00 to 23)." To demonstrate the issue: 1. Create a new blank database. 2. Create a new unbound form. 3. Add an unbound Text Box. 4. Set it's Format Property to "mm/dd/yyyy hh:nn". 5. Waste the next hour zorking around trying to get it to display military time for hours less than 10. (OK, go ahead and bind it to a Table Date/Time Field. Waste two hours. Fool with the Input Mask Property. Waste three hours.) This Format Property issue also applies to Reports, but can be kludged by crafting a calculated Control with the Control Source set to an expression calling the Format Function with the same format string (=Format([MyDateTime], "mm/dd/yyyy hh:nn")), which works as documented, but this technique is useless for Form data-entry Controls that need to display military time. |
#5
|
|||
|
|||
Format Property bug: "hh" doesn't display leading zero
Brendan Reynolds wrote:
Seems to work as documented for me. Tested in both Access 2003 and Access 2000. Here's the result ... http://brenreyn.brinkster.net/format.jpg You made me look Brendan. Apparently if your regional settings in Control Panel are set up with hh: instead of h: then it works. Without that then (Access 97 at least) definitely ignores the leading zero on the hour even when the format property calls for it. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#6
|
|||
|
|||
Format Property bug: "hh" doesn't display leading zero
Thanks Rick. I can reproduce that in Access 2000, but not in Access 2003. So it looks like it may have been fixed in either Access 2002 or Access 2003. I don't have an installation of Access 2002 available to test. My tests also involved two different versions of Windows. Access 2000 is running on Window 98, Access 2003 on Windows XP SP2. So I can not rule out the possibility that the problem may be related to the OS version. -- Brendan Reynolds Access MVP "Rick Brandt" wrote in message om... Brendan Reynolds wrote: Seems to work as documented for me. Tested in both Access 2003 and Access 2000. Here's the result ... http://brenreyn.brinkster.net/format.jpg You made me look Brendan. Apparently if your regional settings in Control Panel are set up with hh: instead of h: then it works. Without that then (Access 97 at least) definitely ignores the leading zero on the hour even when the format property calls for it. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#7
|
|||
|
|||
Format Property bug: "hh" doesn't display leading zero
I noticed that with h: in the regional settings the format is ignored, but
you can apply the format h:nn even if hh: is the default. It works one way, but not the other. An, um, oversight, I guess. "Rick Brandt" wrote in message om... Brendan Reynolds wrote: Seems to work as documented for me. Tested in both Access 2003 and Access 2000. Here's the result ... http://brenreyn.brinkster.net/format.jpg You made me look Brendan. Apparently if your regional settings in Control Panel are set up with hh: instead of h: then it works. Without that then (Access 97 at least) definitely ignores the leading zero on the hour even when the format property calls for it. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#8
|
|||
|
|||
Format Property bug: "hh" doesn't display leading zero
Brendan Reynolds wrote:
Thanks Rick. I can reproduce that in Access 2000, but not in Access 2003. So it looks like it may have been fixed in either Access 2002 or Access 2003. I don't have an installation of Access 2002 available to test. My tests also involved two different versions of Windows. Access 2000 is running on Window 98, Access 2003 on Windows XP SP2. So I can not rule out the possibility that the problem may be related to the OS version. Good point. I only have A97 here at home, but I am running WinXP SP2 so (for A97 at least) the newer OS doesn't fix the problem. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#9
|
|||
|
|||
Format Property bug: "hh" doesn't display leading zero
Thanks again, Rick. Probably not an OS issue then.
It would be interesting to hear if anyone can reproduce the problem using Access 2002 or Access 2003. -- Brendan Reynolds Access MVP "Rick Brandt" wrote in message om... Brendan Reynolds wrote: Thanks Rick. I can reproduce that in Access 2000, but not in Access 2003. So it looks like it may have been fixed in either Access 2002 or Access 2003. I don't have an installation of Access 2002 available to test. My tests also involved two different versions of Windows. Access 2000 is running on Window 98, Access 2003 on Windows XP SP2. So I can not rule out the possibility that the problem may be related to the OS version. Good point. I only have A97 here at home, but I am running WinXP SP2 so (for A97 at least) the newer OS doesn't fix the problem. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com |
#10
|
|||
|
|||
Format Property bug: "hh" doesn't display leading zero
Bruce, Rick, Brandon:
I changed my Regional Settings to "hh:" and voila, and it was displaying "08/17/2006 01:45" when I switched back to the Access window. I had the problem running Access 2000 on Windows 2000. Now I'm going to have to figure out the implications of changing the default. I'm under the impression that the whole point of the Format Property is to override the default. Thanks for your solution to the mystery! [Any idea why my identifier is my e-mail address?] |
|
Thread Tools | |
Display Modes | |
|
|