Date comparison in IIF statement in a query

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.
 
M

Marshall Barton

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.
 

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