Date comparison in IIF statement in a query

  • Thread starter Thread starter LL
  • Start date Start date
L

LL

I have a form with a control containing a date. This date is used in a query
as part of a IIF statement included in the criteria row of the query:

IIf(IsNull([Forms]![RiderMatchAnalysis]![Start
Date]),[Meeting]![MeetingDate],>[Forms]![RiderMatchAnalysis]![Start Date])

The syntax must be wrong in some way as it does not return any records.

Any help would be appreciated.

Thanks.
 
LL said:
I have a form with a control containing a date. This date is used in a query
as part of a IIF statement included in the criteria row of the query:

IIf(IsNull([Forms]![RiderMatchAnalysis]![Start
Date]),[Meeting]![MeetingDate],>[Forms]![RiderMatchAnalysis]![Start Date])

The syntax must be wrong in some way as it does not return any records.


You can not include a partial expression (operator) inside a
function because function just return a value.

Try something more like:

(thefield = Meeting.MeetingDate And
Forms!RiderMatchAnalysis![Start Date] Is Null)
OR thefield > Forms!RiderMatchAnalysis![Start Date]

I suggest that you make that change in SQL view before
seeing how Access messes with it in design view.
 
Back
Top