Selecting records based on time. Example: >07:30:00 AM

G

Guest

I have a list of records and I want to select the records with times less
than 07:30:00 AM. I keep getting a mismatch error when I try to run it. I'm
trying to use the IFF statement to flag these events.

I have tried

IFF([TEXT16] >07:30:00 am,RED, BLUE)

I'm wanting it to flag a field in the query with RED when it is greater that
07:30 AM and flag it BLUE when less that 7:30 AM.
 
A

Allen Browne

Enclose the literal time value in #, e.g.:
=IFF([TEXT16] > #07:30:00 am#,RED, BLUE)

Not sure where you are trying to use this expression.
If you are using conditional formatting, you would set it up for:
Expression [TEXT16] > #07:30:00#
and click the red color.

(Conditional Formatting is on the Format menu in form/report design, in
Access 2000 and later.)
 
R

raskew via AccessMonster.com

Suspect it's just a typo, but just in case:
It's the IIF() function, not IFF()


Allen said:
Enclose the literal time value in #, e.g.:
=IFF([TEXT16] > #07:30:00 am#,RED, BLUE)

Not sure where you are trying to use this expression.
If you are using conditional formatting, you would set it up for:
Expression [TEXT16] > #07:30:00#
and click the red color.

(Conditional Formatting is on the Format menu in form/report design, in
Access 2000 and later.)
I have a list of records and I want to select the records with times less
than 07:30:00 AM. I keep getting a mismatch error when I try to run it.
[quoted text clipped - 8 lines]
that
07:30 AM and flag it BLUE when less that 7:30 AM.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top