?
Solved

Minor Time format problem

Posted on 2004-08-02
18
Medium Priority
?
319 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
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 
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 500 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 500 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

770 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