Solved

Minor Time format problem

Posted on 2004-08-02
18
314 Views
Last Modified: 2010-05-18
I have a bunch of places in my database where Date/Time format is set to Short Time and input mask is also Short Time.  It is showing 1pm as 13:00 and 4am as 4:00 (no leading zero).  How do I make it show the leading zero for times before noon?
0
Comment
Question by:bastille2
  • 11
  • 6
18 Comments
 

Author Comment

by:bastille2
ID: 11700228
Flavo,  If you're reading this - I only noticed the problem because YOUR time formatting DOES show the leading zero...and I like it.  Bob
0
 
LVL 34

Expert Comment

by:flavo
ID: 11700249
You said before you have an input mask in your table?? is that right??  what are you setting in the table??

You can set the format in the table (in design mode) and sleect "short time" form the list

Dave
0
 

Author Comment

by:bastille2
ID: 11700260
Format "Short Time"  Input mask "00:00;0;_" for the field.  Do you mean that it can be set for the table as a whole?
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 34

Expert Comment

by:flavo
ID: 11700280
The help says "hh:nn" will show 00:00, but it doesnt. (not at least with XP)

I even changes right back the short time once i enter it.

Maybe a bug, ill invesigate.

Going off the documnetation, it should show leading zeros.

0
 
LVL 34

Expert Comment

by:flavo
ID: 11700308
http://support.microsoft.com/default.aspx?scid=kb;en-us;130514

Says that hh:nn should work, i cant get it working.  may work in older (A97 / 2000) but cant say for sure.  I use A97 at work and im sure it works.

Dave
0
 
LVL 34

Expert Comment

by:flavo
ID: 11700311
when i use hh:nn it  still shows 6:00, even with the input mask 00:00;0;_ and add the zero, it just gets rid of it.
0
 

Author Comment

by:bastille2
ID: 11700330
As a fallback position, is there an 'easy' way to make your code show without the leading zero?  It would be nice to have them all 00:00 but 0:00 wouldn't kill me as long as it was consistent throughout the database.  If it would mean more ((('s and))))))'s I'm willing to leave well enough alone.
0
 
LVL 34

Assisted Solution

by:flavo
flavo earned 125 total points
ID: 11700341
Try changing "short date" to "h:nn"  (no need to play with ()()()()()(()))

Dave
0
 
LVL 34

Expert Comment

by:flavo
ID: 11700342
not "try changing"

Change (does work)

Dave
0
 
LVL 34

Expert Comment

by:flavo
ID: 11700347
I would still like to know why with a query it returns 01:00, while when you set it to a table, it returns 1:00.

The mind boggles sometimes.....
0
 

Author Comment

by:bastille2
ID: 11700391
When you say "Short Date", do you mean "Short Time"?
0
 
LVL 34

Expert Comment

by:flavo
ID: 11700396
Yes sorry, replace "short time" with "h:nn"

Dave
0
 
LVL 34

Expert Comment

by:flavo
ID: 11700398
{and yes it is h:nn not h:mm}

m = month
n = minutes

Dave
0
 
LVL 16

Accepted Solution

by:
GreymanMSC earned 125 total points
ID: 11700399
It reflects your computer's Regional and Language options (formerly known as the International Settings). Which it bloody well shouldn't!
 
Silly Access XP is just trying to be helpful, but this is annoying.  If you tell Access that you wish to display time with leading zeros, or not, it should do so reguardless of the international settings.
 
Go to (Windows Taskbar) Start > Settings > Control Panel > Regional And Language Options.
 
On the Regional Options tab, click the Customize button. On the Time tab of the next form, the Time format will probably look like: h:mm:ss tt so change it to hh:mm:ss tt and voila, the hh:nn format will be displayed with leading zeros.
0
 
LVL 34

Expert Comment

by:flavo
ID: 11700407
So why does query format(....,"short time") work and not table??

Doesnt really help if you distrubute your app.  (although im sure there would be an API somewhere to change it)

Nice to see they make things "easy" for use these days... jerks!!
0
 

Author Comment

by:bastille2
ID: 11700411
Thank you GreymanMSC.  Would anyone else like to offer a comment on this fix before I implement it?
0
 

Author Comment

by:bastille2
ID: 11700424
Good point Flavo.  If the regional settings are only going to affect my laptop, it won't help all the people who will be using the database on their machines.  It may be best to leave it alone.
0
 
LVL 34

Expert Comment

by:flavo
ID: 11700447
Im not one of those i hate everything MS just because its MS people, but
%$^$%!!!!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now