GrandMasterTuck
In need of medication
- Local time
- Today, 18:33
- Joined
- May 4, 2013
- Messages
- 129
[SOLVED] An IIF statement with a Date-1
Hi everybody. I have a query that fetches the value of the EditFormWeekday field on the frmEditForm form (LOL... that sounds hilarious when I say it in my head... must be the drugs...)
Anyway, this query is supposed to filter the list of names based upon the values in two fields on the form: EditFormWeekday and EditFormShift. If the value of the EditFormShift is NOT "MIDS", it is supposed to filter out all records that match the EditFormWeekday. If the EditFormShift IS "MIDS", it's supposed to filter out all records that have an EditFormWeekday value that is the day BEFORE the EditFormWeekday shown. And I can't figure out how to word the syntax in the Query Builder.
Here's what I have in the Criteria box for the Weekday in the query:
IIF([Forms]![frmEditForm]![EditFormShift]="MIDS",
Not Like [Forms]![frmEditForm]![EditFormWeekday]-1,
Not Like [Forms]![frmEditForm]![EditFormWeekday])
Can anybody tell me what I'm doing wrong here? I also tried putting the NOT LIKE before the IIF, but that gave me an error, too.
Hi everybody. I have a query that fetches the value of the EditFormWeekday field on the frmEditForm form (LOL... that sounds hilarious when I say it in my head... must be the drugs...)
Anyway, this query is supposed to filter the list of names based upon the values in two fields on the form: EditFormWeekday and EditFormShift. If the value of the EditFormShift is NOT "MIDS", it is supposed to filter out all records that match the EditFormWeekday. If the EditFormShift IS "MIDS", it's supposed to filter out all records that have an EditFormWeekday value that is the day BEFORE the EditFormWeekday shown. And I can't figure out how to word the syntax in the Query Builder.
Here's what I have in the Criteria box for the Weekday in the query:
IIF([Forms]![frmEditForm]![EditFormShift]="MIDS",
Not Like [Forms]![frmEditForm]![EditFormWeekday]-1,
Not Like [Forms]![frmEditForm]![EditFormWeekday])
Can anybody tell me what I'm doing wrong here? I also tried putting the NOT LIKE before the IIF, but that gave me an error, too.
Last edited: