Time Format - Need all 4 digits shown

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

Hi,

I have an operations database that tracks our tug boat voyages and use the
standard 24 hour timeclock. The times are shown with the short time format,
but I need all 4 digits to show. In the maritime world, time is always
shown in 4 digits. In Excel you can do it by setting the format to [hh]:mm
Supposedly, if Excel can do it, Access can too. So how does it?

Thanks,
Captain Scott Carter
Sause Brothers Inc
Honolulu Hawaii
 
You can do this in Access by setting the Format property for the control or
by using the Format function, depending on what you're trying to do. Another
option, if you want everything this way, would be to go to Regional Settings
in Control Panel and change the description of Short Date to give you all
four digits.

Example Format property for a control:
hh:mm
 
If they wouldn't put the n and m so close together on the keyboard.... Oh
well. :-) Thanks, John.
 
Alphabetically, minutes comes before months so long ago Bill should have
assigned "m" to minutes. And since "m" was already taken when he came to month,
Bill should have assigned "n" to month. So you see, you were logically right
with hh:mm; Bill was in error! Perhaps Bill was using reverse polish notation
when he assigned "m" and "n".

Steve
PC Datasheet
 
For the life of me I believe that this is what I already tried...But I will
check it tmro when I get back to work. I couldn't find the details of the
format code [hh]:nn in help. Is that what forces the leading zero?

I suppose its possible that it can show with the leading zero in a query,
but not come thru in the report with the same data? I'll try to go back to
the entry level data (the table where it is initally placed) and check the
properties for that control.

Thanks for the quick replies,
Scott

Wayne Morgan said:
You can do this in Access by setting the Format property for the control or
by using the Format function, depending on what you're trying to do. Another
option, if you want everything this way, would be to go to Regional Settings
in Control Panel and change the description of Short Date to give you all
four digits.

Example Format property for a control:
hh:mm

--
Wayne Morgan
Microsoft Access MVP


scott said:
Hi,

I have an operations database that tracks our tug boat voyages and use the
standard 24 hour timeclock. The times are shown with the short time
format,
but I need all 4 digits to show. In the maritime world, time is always
shown in 4 digits. In Excel you can do it by setting the format to
[hh]:mm
Supposedly, if Excel can do it, Access can too. So how does it?

Thanks,
Captain Scott Carter
Sause Brothers Inc
Honolulu Hawaii
 
Scott, Yes that [hh] is what forces the leading zero. Lookup Format in help
and click the Format Property then select the Date/Time Data Type link.
Scroll down and there's a list of the different formats. Keep in mind that
if you change the format at the table level you will still have to either
add the format to the controls on the forms/reports because it will not
automatically be set. The other thing you could do is delete the control
and re-add it to the form/report and your new format will be set for you.

--
Reggie

----------
scott said:
For the life of me I believe that this is what I already tried...But I will
check it tmro when I get back to work. I couldn't find the details of the
format code [hh]:nn in help. Is that what forces the leading zero?

I suppose its possible that it can show with the leading zero in a query,
but not come thru in the report with the same data? I'll try to go back to
the entry level data (the table where it is initally placed) and check the
properties for that control.

Thanks for the quick replies,
Scott

You can do this in Access by setting the Format property for the control or
by using the Format function, depending on what you're trying to do. Another
option, if you want everything this way, would be to go to Regional Settings
in Control Panel and change the description of Short Date to give you all
four digits.

Example Format property for a control:
hh:mm

--
Wayne Morgan
Microsoft Access MVP


scott said:
Hi,

I have an operations database that tracks our tug boat voyages and use the
standard 24 hour timeclock. The times are shown with the short time
format,
but I need all 4 digits to show. In the maritime world, time is always
shown in 4 digits. In Excel you can do it by setting the format to
[hh]:mm
Supposedly, if Excel can do it, Access can too. So how does it?

Thanks,
Captain Scott Carter
Sause Brothers Inc
Honolulu Hawaii
 
Scott,

I just tried this again and Access is insisting on "helping" me out by
changing hh:nn to Short Time and dropping the leading zero. To bypass this
"help", make the control a calculated control.

Control Source:
=Format([FieldName], "hh:nn")

Actually, I just tried this, it still insisted and changing "hh:nn" to
"Short Time", but it left the leading zero in when I went to print preview.
 
Back
Top