date query

  • Thread starter Thread starter brigid
  • Start date Start date
B

brigid

I'm trying to do a query where if there is a blank field
it returns true, and if there is a date in that field it
returns false. This is what I have:

Expr1: IIf(([SIR/DIR]![Occurred To Date]=""),1,0)

When I run the query it gives me a zero for all the blank
fields, but #Error wherever there is a date entered. Any
suggestions?
 
The value will be Null if there is nothing in the Date/Time field. Try:
Expr1: IIf([SIR/DIR]![Occurred To Date] Is Null, True, False)

If Occurred To Date is not a true date/time field, and you want to know if
the value there can be interpreted as a date or not, try:
Expr1: Not (IsDate([SIR/DIR]![Occurred To Date]))
 
Back
Top