iif statement with data parameter not working

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

Guest

I am trying to run a query on a table (called SETS) that includes a date
field (short date). If the date equals a specific date I want to return
"Yes", if not I want to return "No". Here is the statement I am trying to
run:

Available: iif([SETS].[Date]=9/1/2006,"Yes","No")

The result set displays No in the all the Available fields. If I change the
"Date" field from date to text in the underlying table it works but I want to
keep it as a date field.

Any suggestions?
 
Try

Available: iif([SETS].[Date]=#9/1/2006#,"Yes","No")

A date criteria need to be between #, other wise it will treat it as number
and devide it.
 
You're my hero!

Thanks so much.



Ofer Cohen said:
Try

Available: iif([SETS].[Date]=#9/1/2006#,"Yes","No")

A date criteria need to be between #, other wise it will treat it as number
and devide it.

--
Good Luck
BS"D


PBISMaryland said:
I am trying to run a query on a table (called SETS) that includes a date
field (short date). If the date equals a specific date I want to return
"Yes", if not I want to return "No". Here is the statement I am trying to
run:

Available: iif([SETS].[Date]=9/1/2006,"Yes","No")

The result set displays No in the all the Available fields. If I change the
"Date" field from date to text in the underlying table it works but I want to
keep it as a date field.

Any suggestions?
 
Back
Top