Time Format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I would like to show in a query the time formatted to look like:

HH:MM A or P

In other words I want to show hours and minutes followed by an A if it's AM
or a P if it's PM. Can anyone help? Thanks in advance.

Janet
 
I usually format values in controls on forms or reports, however you can
use:
Format([UnnamedTimeField], "HH:MM A/P")
 
Duane,

I'm working with unfamiliar data which won't end up in a form or a report.
It's a query that I'm running and will eventually export to create a fixed
format file. I thought the date format was HH:MM but it's actually a text
field and users enter just four numbers such as 0400 or 1355. I need it to
look like 04:00 A or 13:55 P. What you gave me just gives back 12:00 A for
every record.

thanks,
Janet

Duane Hookom said:
I usually format values in controls on forms or reports, however you can
use:
Format([UnnamedTimeField], "HH:MM A/P")

--
Duane Hookom
MS Access MVP
--

JanetF said:
Hello,

I would like to show in a query the time formatted to look like:

HH:MM A or P

In other words I want to show hours and minutes followed by an A if it's
AM
or a P if it's PM. Can anyone help? Thanks in advance.

Janet
 
1355 is 24 hour time and does not use AM and PM.

I think what you want is this --
IIf(Left([time],2)<12,Left([time],2) & ":" & Right([time],2) & "
A",Left([time],2)-12 & ":" & Right([time],2) & " P")

JanetF said:
Duane,

I'm working with unfamiliar data which won't end up in a form or a report.
It's a query that I'm running and will eventually export to create a fixed
format file. I thought the date format was HH:MM but it's actually a text
field and users enter just four numbers such as 0400 or 1355. I need it to
look like 04:00 A or 13:55 P. What you gave me just gives back 12:00 A for
every record.

thanks,
Janet

Duane Hookom said:
I usually format values in controls on forms or reports, however you can
use:
Format([UnnamedTimeField], "HH:MM A/P")

--
Duane Hookom
MS Access MVP
--

JanetF said:
Hello,

I would like to show in a query the time formatted to look like:

HH:MM A or P

In other words I want to show hours and minutes followed by an A if it's
AM
or a P if it's PM. Can anyone help? Thanks in advance.

Janet
 
Hi Karl,

Actually what that gives me is 1:55 P for 1355 and I still want it to say
1355 just with a : between the 13 and the 55. Also, it's not showing A's at
all, just P's. Thanks.

Janet

KARL DEWEY said:
1355 is 24 hour time and does not use AM and PM.

I think what you want is this --
IIf(Left([time],2)<12,Left([time],2) & ":" & Right([time],2) & "
A",Left([time],2)-12 & ":" & Right([time],2) & " P")

JanetF said:
Duane,

I'm working with unfamiliar data which won't end up in a form or a report.
It's a query that I'm running and will eventually export to create a fixed
format file. I thought the date format was HH:MM but it's actually a text
field and users enter just four numbers such as 0400 or 1355. I need it to
look like 04:00 A or 13:55 P. What you gave me just gives back 12:00 A for
every record.

thanks,
Janet

Duane Hookom said:
I usually format values in controls on forms or reports, however you can
use:
Format([UnnamedTimeField], "HH:MM A/P")

--
Duane Hookom
MS Access MVP
--

Hello,

I would like to show in a query the time formatted to look like:

HH:MM A or P

In other words I want to show hours and minutes followed by an A if it's
AM
or a P if it's PM. Can anyone help? Thanks in advance.

Janet
 
JanetF,
Why don't you provide a list of sample values and how you would expect them
to appear in your query? It seems to most of us that showing a military time
would not display either AM or PM or A or P.

Please help us out by taking a little time to type in your records...

--
Duane Hookom
MS Access MVP
--

JanetF said:
Hi Karl,

Actually what that gives me is 1:55 P for 1355 and I still want it to say
1355 just with a : between the 13 and the 55. Also, it's not showing A's
at
all, just P's. Thanks.

Janet

KARL DEWEY said:
1355 is 24 hour time and does not use AM and PM.

I think what you want is this --
IIf(Left([time],2)<12,Left([time],2) & ":" & Right([time],2) & "
A",Left([time],2)-12 & ":" & Right([time],2) & " P")

JanetF said:
Duane,

I'm working with unfamiliar data which won't end up in a form or a
report.
It's a query that I'm running and will eventually export to create a
fixed
format file. I thought the date format was HH:MM but it's actually a
text
field and users enter just four numbers such as 0400 or 1355. I need
it to
look like 04:00 A or 13:55 P. What you gave me just gives back 12:00 A
for
every record.

thanks,
Janet

:

I usually format values in controls on forms or reports, however you
can
use:
Format([UnnamedTimeField], "HH:MM A/P")

--
Duane Hookom
MS Access MVP
--

Hello,

I would like to show in a query the time formatted to look like:

HH:MM A or P

In other words I want to show hours and minutes followed by an A if
it's
AM
or a P if it's PM. Can anyone help? Thanks in advance.

Janet
 
Just remove the -12 from the expression.

I do not know about your data as it gives me the A's.

JanetF said:
Hi Karl,

Actually what that gives me is 1:55 P for 1355 and I still want it to say
1355 just with a : between the 13 and the 55. Also, it's not showing A's at
all, just P's. Thanks.

Janet

KARL DEWEY said:
1355 is 24 hour time and does not use AM and PM.

I think what you want is this --
IIf(Left([time],2)<12,Left([time],2) & ":" & Right([time],2) & "
A",Left([time],2)-12 & ":" & Right([time],2) & " P")

JanetF said:
Duane,

I'm working with unfamiliar data which won't end up in a form or a report.
It's a query that I'm running and will eventually export to create a fixed
format file. I thought the date format was HH:MM but it's actually a text
field and users enter just four numbers such as 0400 or 1355. I need it to
look like 04:00 A or 13:55 P. What you gave me just gives back 12:00 A for
every record.

thanks,
Janet

:

I usually format values in controls on forms or reports, however you can
use:
Format([UnnamedTimeField], "HH:MM A/P")

--
Duane Hookom
MS Access MVP
--

Hello,

I would like to show in a query the time formatted to look like:

HH:MM A or P

In other words I want to show hours and minutes followed by an A if it's
AM
or a P if it's PM. Can anyone help? Thanks in advance.

Janet
 
Back
Top