Iif Statement based on 2 conditions

T

Thorson

Is it possible to do an Iif statment in a query based on 2 conditions?

This is what I currently have (if dates are not in the same month put
correction otherwise null):

Correction:
IIf(Month([qryDSACMonthlyDispositionRecords]![EntryDate])<>([qryDSACMonthlyDispositionRecords]![Expr1]),"Correction",Null)

I would like to change it to If dates are in the same month and the day in
the date ([qryDSACMonthlyDispositionRecords]![EntryDate]) is 5 or less then
put correction otherwise put null.

How do I write this?

Thanks for the help!
 
J

John Spencer

Probably

IIf(Month([qryDSACMonthlyDispositionRecords]![EntryDate])<>[qryDSACMonthlyDispositionRecords]![Expr1]
AND Day([qryDSACMonthlyDispositionRecords]![EntryDate])<=5,"Correction",Null)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
T

Thorson

Works Perfectly! Thank you!
--
Thorson


John Spencer said:
Probably

IIf(Month([qryDSACMonthlyDispositionRecords]![EntryDate])<>[qryDSACMonthlyDispositionRecords]![Expr1]
AND Day([qryDSACMonthlyDispositionRecords]![EntryDate])<=5,"Correction",Null)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Is it possible to do an Iif statment in a query based on 2 conditions?

This is what I currently have (if dates are not in the same month put
correction otherwise null):

Correction:
IIf(Month([qryDSACMonthlyDispositionRecords]![EntryDate])<>([qryDSACMonthlyDispositionRecords]![Expr1]),"Correction",Null)

I would like to change it to If dates are in the same month and the day in
the date ([qryDSACMonthlyDispositionRecords]![EntryDate]) is 5 or less then
put correction otherwise put null.

How do I write this?

Thanks for the help!
 

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

Similar Threads

Iif Statment 7
IIF statement in a Query ? 5
Iif with And conditions 3
IIF with wildcard and OR... 1
IIf statement 2
Invalid use of null 3
Iif/IsNull Question 6
IIf funtion based on multiple criteria 2

Top