Solved

Minor Time format problem

Posted on 2004-08-02
18
318 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

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.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

690 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