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

Top