IIF OR Statement Issue

proevn

New Member
Joined
Apr 26, 2018
Messages
2
I have this long IIF statement. Access appears to be placing [] around my quoted TRUE statement in the OR part of the statement.

Here is the query:

Closed Date: IIf([Delta].[Closed]="Y",IIf([Delta].[Actual End Date] Is Null,[Delta].[Last Update Date],[Delta].[Actual End Date]),IIf([Task Status]=[“Completed”] Or ([Task Status]=[“Rejected”]) Or ([Task Status]=[“Cancelled”]),IIf([Delta].[Actual End Date] Is Null,[Delta].[Last Update Date],[Delta].[Actual End Date])))

Any idea??? I am new to access and trying to work through this. Thanks,
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Welcome to the Board!

You only put square brackets off of table and field names. Remove them from the values you are checking. Also, Access is particular and does not like slanted double-quotes, it wants straight ones.
So change all things structured like this:
Code:
[COLOR=#333333]=[“Completed”] [/COLOR]
to this:
Code:
="Completed"
 
Upvote 0
Welcome to the Board!

You only put square brackets off of table and field names. Remove them from the values you are checking. Also, Access is particular and does not like slanted double-quotes, it wants straight ones.
So change all things structured like this:
Code:
[COLOR=#333333]=[“Completed”] [/COLOR]
to this:
Code:
="Completed"

So that is what I have been entering, but when I click off the query field, Access was automatically putting the bracket around the values I was checking.

However, it looks like maybe the slanted double quotes fixed this issue.
 
Upvote 0
It seems like an overly complicated way of calculating what you are calculating... does something like the following work:

Code:
Closed Date: IIf([Delta].[Closed]="Y" Or [Task Status] In ("Completed","Rejected","Cancelled"),Nz([Delta].[Actual End Date],[Delta].[Last Update Date]))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top