IIF statement for query

JoeyGaspard

Board Regular
Joined
Jul 22, 2019
Messages
164
I have a working IIF statement with multiple conditions in an Access query:
Points: (IIf([AbsentT]![AbDate]>=Date()-28 And [AbReason]="Unexcused","1",IIf([AbsentT]![AbDate]>=Date()-28 And [AbReason]="Late",".5",IIf([AbsentT]![AbDate]>=Date()-28 And [AbReason]="Left",".5",""))))

I need to add the criteria of a specific day (ex Monday), so it will basically say if all the above is true and the day = Monday or Saturday, then 1.5, else, as is in above statement, hope that makes sense!
I dont have a field that list the days of the week, but I am hoping Access is smart enough to know by the date?

In summary, I need to say if its less than 28 days from today, Unexcused, a monday or saturday, then 1.5, if not monday or saturday, then 1, and if absreason is Left, .5.

Im sorry if I havent explained this well. Thanks in advance for any help!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I would suggest that your query calculated field should call a function that will return whatever value you need. If you need help with that, you probably need to clarify or hope that someone gets lucky with the interpretation. I had written more, but since you're asking for closure I'll leave my post at that.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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