Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another nested if quandry

Status
Not open for further replies.

cookie5

Programmer
Jan 19, 2003
47
US
I had the following sql working correctly:

Sum(([workorders empdetails]![Emp 1 Hours:]*[Employees]![PayRatew/Benefits])/IIf([SBL],2,1)) AS [Totalreg Labor],

Then I had to add another condition checking for checkboxes RTA, RTB, RTC, RTD, RTE. If one is checked I want to multiply by the percentage in RTAper or RTBper or RTCper or RTDper or RTEper according to which check box is checked, so now my sql is

Sum(([workorders empdetails]![Emp 1 Hours:]*[Employees]![PayRatew/Benefits])*IIf([RTA],RTAper,1)*IIf([RTB],
[RTBper],1)*IIf([RTC],[RTCper],1)*IIf([RTD],[RTDper],1)*IIf([RTE],[RTEper],
1)/IIf([SBL],2,1)) AS [Totalreg Labor],

When I run the query with one of the checkboxes checked, it does not multiply by the per for that checkbox.
Any help would be greatly appreciated.....again.
 
P.S.
RTAper,RTBper,RTCper,RTDper and RTEper are the results from previous queries. When I run the query with the above sql it shows the percentages EXCEPT when the checkbox for the corresponding per is checked, then it does not show the per and puts nothing in the Totalreg Labor field. I hope this better explains my problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top