Solved

Minor Time format problem

Posted on 2004-08-02
18
311 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 34

Expert Comment

by:flavo
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Try changing "short date" to "h:nn"  (no need to play with ()()()()()(()))

Dave
0
 
LVL 34

Expert Comment

by:flavo
Comment Utility
not "try changing"

Change (does work)

Dave
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 34

Expert Comment

by:flavo
Comment Utility
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
Comment Utility
When you say "Short Date", do you mean "Short Time"?
0
 
LVL 34

Expert Comment

by:flavo
Comment Utility
Yes sorry, replace "short time" with "h:nn"

Dave
0
 
LVL 34

Expert Comment

by:flavo
Comment Utility
{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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you GreymanMSC.  Would anyone else like to offer a comment on this fix before I implement it?
0
 

Author Comment

by:bastille2
Comment Utility
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
Comment Utility
Im not one of those i hate everything MS just because its MS people, but
%$^$%!!!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

744 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

18 Experts available now in Live!

Get 1:1 Help Now