Steve Turner
sturner at mseco.com
Thu Jun 20 11:54:20 CDT 2013
Guys, I have a query that uses this expression AvgCost: I'm trying to add the second line iif([CAT] = 4 to the end of the first line after [SumOfBillHours] as an additional condition but the number of parentheses is giving me fits when I try to save it. Keeps telling me I have the wrong number of them and I add and add but to no avail. Anyone see why it won't work. Missing a parentheses somewhere I guess. The first line works but I needed to add one more condition. First Line: AvgCost: Round(IIf([CAT]=3,[RCOST],IIf([CAT]=1,[RCOST]/[SumOfBillHours],IIf([CAT] =2,IIf([SumOfBillHours]<=40,[RCOST],(([RCOST]*40)+([SumOfBillHours]-40)* [OTCOST])/[SumOfBillHours])))),2) Second Line: IIf([CAT]=4,IIf([SumOfBillHours]<=50,[RCOST],(([RCOST]*50)+([SumOfBillHo urs]-50)*[OTCOST])/[SumOfBillHours]) Steve A.Turner Controller Mid-South Engineering Co. Inc. P.O. Box 1399 1658 Malvern Ave. Hot Springs, AR 71902 Phone: 501-321-2276 Fax 501-321-4750 Cell 501-282-7751 Email sturner at mseco.com