L
LisaInAz
Hi - I have read all the "complex IIF" statement and research the Switch
Function.
I have a table that contains Instructors, various Dollar Amount to Charge
{AMT1...BAMT4}, based on an age grouping, based on whether it is for a Full
Day or Half a day. The Data on the table is as ADay AAmt1 AAmt2
AAmt3 AAmt4 or BDay BAmt0 BAmt1 BAmt3 BAmt4. The Full or Part day data
could be in either "set" of fields
Based on my clients Age I want to "display" the Amt Charged for the Day
criteria
Example: 3-5 6-9 10-12 13-18
FULL DAY (D) 23.60 21.20 25.90 35.00
PART DAY(L) 8.65 9.80 10.15 15.00
I have had some success with SWITCH FUNCTION in a Query
Switch([ChildAge]>0,[AAMT1],[ChildAge]>5,[AAMT2],[ChildAge]>9,[AAMT3],[ChildAge]>12,[AAMT4],[ChildAge]>18,99)
But when I try to add in the DAY so I can insure I am getting the correct
field the Display Field Shows #Error
Switch([ADAY]="L" And [ChildAge]>0,[AAMT1],[ADAY]="L" And
[ChildAge]>5,[AAMT2],[ADAY]="L" And [ChildAge]>9,[AAMT3],[ADAY]="L" And
[ChildAge]>12,[AAMT4],[ChildAge]>18,[BDAY]="L" And
[ChildAge]>0,[BAMT1],[BDAY]="L" And [ChildAge]>5,[BAMT2],[KND002]="L" And
[ChildAge]>9,[BDAY3],[KND002]="L" And [ChildAge]>12,[BDAY4],[ChildAge]>18,99)
I also should share that any of the Amount Charge fields could be Null if
the instructor doesn't teach that age group
I am not very strong in coding. I tried an IIF statement and totally bombed
it.
Any suggestions or other ways would be so very helpful as I am under a time
crunch and struggling.
Thank you in Advance.
Function.
I have a table that contains Instructors, various Dollar Amount to Charge
{AMT1...BAMT4}, based on an age grouping, based on whether it is for a Full
Day or Half a day. The Data on the table is as ADay AAmt1 AAmt2
AAmt3 AAmt4 or BDay BAmt0 BAmt1 BAmt3 BAmt4. The Full or Part day data
could be in either "set" of fields
Based on my clients Age I want to "display" the Amt Charged for the Day
criteria
Example: 3-5 6-9 10-12 13-18
FULL DAY (D) 23.60 21.20 25.90 35.00
PART DAY(L) 8.65 9.80 10.15 15.00
I have had some success with SWITCH FUNCTION in a Query
Switch([ChildAge]>0,[AAMT1],[ChildAge]>5,[AAMT2],[ChildAge]>9,[AAMT3],[ChildAge]>12,[AAMT4],[ChildAge]>18,99)
But when I try to add in the DAY so I can insure I am getting the correct
field the Display Field Shows #Error
Switch([ADAY]="L" And [ChildAge]>0,[AAMT1],[ADAY]="L" And
[ChildAge]>5,[AAMT2],[ADAY]="L" And [ChildAge]>9,[AAMT3],[ADAY]="L" And
[ChildAge]>12,[AAMT4],[ChildAge]>18,[BDAY]="L" And
[ChildAge]>0,[BAMT1],[BDAY]="L" And [ChildAge]>5,[BAMT2],[KND002]="L" And
[ChildAge]>9,[BDAY3],[KND002]="L" And [ChildAge]>12,[BDAY4],[ChildAge]>18,99)
I also should share that any of the Amount Charge fields could be Null if
the instructor doesn't teach that age group
I am not very strong in coding. I tried an IIF statement and totally bombed
it.
Any suggestions or other ways would be so very helpful as I am under a time
crunch and struggling.
Thank you in Advance.