Ok I have an IIF statement in the Field cell in the Query wizard in Access 2000 which works perfectly if I shorten it but if I put in all the criteria it's too long.
What I'm wanting to do is this essentially
If [MON P/U] is not null AND [WEEKDAY]=2 AND [TIME]=AM
Then the field will =AM
If false the field is null
If [MON D/O] is not null AND [WEEKDAY]=2 AND [TIME]=PM
Then the field will =PM
If false the field is null
This I need done for the rest of the weekday's as well.
This is the expression I'm using.
IIf([MON P/U] Is Not Null and [WEEKDAY]=2 and [TIME]="AM","AM", IIf([MON D/O] Is Not Null and [WEEKDAY]=2 and [TIME]="PM","PM", IIf([TUE P/U] Is Not Null and [WEEKDAY]=3 and [TIME]="AM","AM", IIf([TUE D/O] Is Not Null and [WEEKDAY]=3 and [TIME]="PM","PM", IIf([WED P/U] Is Not Null and [WEEKDAY]=4 and [TIME]="AM","AM", IIf([WED D/O] Is Not Null and [WEEKDAY]=4 and [TIME]="PM","PM", IIf([THUR P/U] Is Not Null and [WEEKDAY]=5 and [TIME]="AM","AM", IIf([THUR D/O] Is Not Null and [WEEKDAY]=5 and [TIME]="PM","PM", IIf([FRI P/U] Is Not Null and [WEEKDAY]=6 and [TIME]="AM","AM", IIf([FRI D/O] Is Not Null and [WEEKDAY]=6 and [TIME]="PM","PM",Null))))))))))
I'm not familiar enough with SQL to do it there and I can't seem to find a way to get to a Visual Basic Code Builder from the Query Builder.
Any help is appreciated.
Thanks
Kathie
What I'm wanting to do is this essentially
If [MON P/U] is not null AND [WEEKDAY]=2 AND [TIME]=AM
Then the field will =AM
If false the field is null
If [MON D/O] is not null AND [WEEKDAY]=2 AND [TIME]=PM
Then the field will =PM
If false the field is null
This I need done for the rest of the weekday's as well.
This is the expression I'm using.
IIf([MON P/U] Is Not Null and [WEEKDAY]=2 and [TIME]="AM","AM", IIf([MON D/O] Is Not Null and [WEEKDAY]=2 and [TIME]="PM","PM", IIf([TUE P/U] Is Not Null and [WEEKDAY]=3 and [TIME]="AM","AM", IIf([TUE D/O] Is Not Null and [WEEKDAY]=3 and [TIME]="PM","PM", IIf([WED P/U] Is Not Null and [WEEKDAY]=4 and [TIME]="AM","AM", IIf([WED D/O] Is Not Null and [WEEKDAY]=4 and [TIME]="PM","PM", IIf([THUR P/U] Is Not Null and [WEEKDAY]=5 and [TIME]="AM","AM", IIf([THUR D/O] Is Not Null and [WEEKDAY]=5 and [TIME]="PM","PM", IIf([FRI P/U] Is Not Null and [WEEKDAY]=6 and [TIME]="AM","AM", IIf([FRI D/O] Is Not Null and [WEEKDAY]=6 and [TIME]="PM","PM",Null))))))))))
I'm not familiar enough with SQL to do it there and I can't seem to find a way to get to a Visual Basic Code Builder from the Query Builder.
Any help is appreciated.
Thanks
Kathie