If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Nested IIf: Define ranges, = And =?
I'm trying to create a commission rate by defining several ranges based on
the Sale_Price field's value. I am creating a calculated field in a query with the following syntax (for lack of a BETTER word) Rate: IIf(([Sale_Price]0 And [Sale_Price]50,".30"), IIf([Sale_Price]=50 And [Sale_Price]=299.99,".25"), IIf([Sale_Price]=300 And [Sale_Price]=999.99,".20"), IIf([Sale_Price]=1000,".15","99")))) I've tweaked this code every way I can think of, currently I'm receiving an error that reads "The expression you entered contains a function with the wrong number of arguments" I'm guessing that is a wordy way of telling me unbalanced parentheses.... Thanks in advance to all the nice people out there who take the time to answer our questions. |
#2
|
|||
|
|||
Nested IIf: Define ranges, = And =?
Rate: IIf([Sale_Price]0 And [Sale_Price]50,".30",IIf([Sale_Price]=50 And
[Sale_Price]=299.99,".25",IIf([Sale_Price]=300 And [Sale_Price]=999.99,".20",IIf([Sale_Price]=1000,".15","99")))) "CanonMaiden" wrote: I'm trying to create a commission rate by defining several ranges based on the Sale_Price field's value. I am creating a calculated field in a query with the following syntax (for lack of a BETTER word) Rate: IIf(([Sale_Price]0 And [Sale_Price]50,".30"), IIf([Sale_Price]=50 And [Sale_Price]=299.99,".25"), IIf([Sale_Price]=300 And [Sale_Price]=999.99,".20"), IIf([Sale_Price]=1000,".15","99")))) I've tweaked this code every way I can think of, currently I'm receiving an error that reads "The expression you entered contains a function with the wrong number of arguments" I'm guessing that is a wordy way of telling me unbalanced parentheses.... Thanks in advance to all the nice people out there who take the time to answer our questions. |
#3
|
|||
|
|||
Nested IIf: Define ranges, = And =?
No fiar! I tried that, I swear!
Thanks, Dennis. "Dennis" wrote: Rate: IIf([Sale_Price]0 And [Sale_Price]50,".30",IIf([Sale_Price]=50 And [Sale_Price]=299.99,".25",IIf([Sale_Price]=300 And [Sale_Price]=999.99,".20",IIf([Sale_Price]=1000,".15","99")))) "CanonMaiden" wrote: I'm trying to create a commission rate by defining several ranges based on the Sale_Price field's value. I am creating a calculated field in a query with the following syntax (for lack of a BETTER word) Rate: IIf(([Sale_Price]0 And [Sale_Price]50,".30"), IIf([Sale_Price]=50 And [Sale_Price]=299.99,".25"), IIf([Sale_Price]=300 And [Sale_Price]=999.99,".20"), IIf([Sale_Price]=1000,".15","99")))) I've tweaked this code every way I can think of, currently I'm receiving an error that reads "The expression you entered contains a function with the wrong number of arguments" I'm guessing that is a wordy way of telling me unbalanced parentheses.... Thanks in advance to all the nice people out there who take the time to answer our questions. |
Thread Tools | |
Display Modes | |
|
|