time query

  • Thread starter Thread starter kathy
  • Start date Start date
K

kathy

Will Access accept military time on the criteria line of a
query?

When I enter <#14:00#

Access changes it to <#2:00:00 PM#

Regardless of how it is identified in the table, short
date, medium date...

Can anyone help?
 
Even though ACCESS "changes" what is displayed, your query should return the
same results ... what you're wanting to do is the "format" of the way the
time is displayed, which has nothing to do with how the time is stored (a
decimal number between 0 and 1 representing the fractional part of a 24-hour
day). So ignore that ACCESS changed the display and continue on your
successful ways!
 
Dear Kathy:

It is first important to recognize that the database does not "store"
the time an any format. Your question is properly about how the time
is displayed, not how it is stored. The way it is stored is
compatible with many ways of displaying that value. So, Access has
not "changed" it to 2:00:00 PM, it has just displayed it that way.

To get it to display otherwise, you can have it formatted in a large
number of ways. In specifying a format for display, please refer to
the online help for the Format function. It includes this:

h Display the hour as a number without leading zeros (0 – 23).
Hh Display the hour as a number with leading zeros (00 – 23).

Clearly you can specify ways to display the hour portion of your
date/time values using a 24 hour clock.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Why do you care how Access displays it? It is _accepting_ your input,
interpreting it correctly, and displaying it in a standard format. I
admit that the particular standard format it chooses wouldn't be my
choice, but it is unambiguous, which is really all that matters in
this context.

Will Access accept military time on the criteria line of a
query?

When I enter <#14:00#

Access changes it to <#2:00:00 PM#

Regardless of how it is identified in the table, short
date, medium date...

Can anyone help?


Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Actually, she can't (change the format in which it is displayed), or
at least not in her specific context. As she states, if you enter a
time value constant _on_ _the_ _criteria_ _line_ _of_ _a_ _query_,
which is what she was asking about, it will (as she correctly states)
be displayed in the h:mm:ss AM/PM format, however you originally
entered it. This is true for time value constants entered in VBA code,
too. As I said earlier, I am not sure why she minds this, but her
observation is correct.

Dear Kathy:

It is first important to recognize that the database does not "store"
the time an any format. Your question is properly about how the time
is displayed, not how it is stored. The way it is stored is
compatible with many ways of displaying that value. So, Access has
not "changed" it to 2:00:00 PM, it has just displayed it that way.

To get it to display otherwise, you can have it formatted in a large
number of ways. In specifying a format for display, please refer to
the online help for the Format function. It includes this:

h Display the hour as a number without leading zeros (0 – 23).
Hh Display the hour as a number with leading zeros (00 – 23).

Clearly you can specify ways to display the hour portion of your
date/time values using a 24 hour clock.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts


Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Back
Top