Re: Access long expression - parenthsis problem



Hi Jason,

I have the below expression which is working fine for me, but not perfect,
because I need one more IIF in the expression, 'iif([Stat07]="R",1), I just
can't make it work after putting this condition in.

BldgAssess07:
Sum(IIf([Stat07]="A",Round([PLrate07]*[KM]*0.1,0),IIf([Stat07]="p",Round([PLrate07]*[KM],0))))

Thanks in advance!

"JasonF" wrote:

You would be much better off creating a custom function for this in
VBA rather than using an if statement. However, here's my shot at the
parentheses problem:

IIf(
(
Round(
(
nz([RuralMill06])*(
(nz([SumOfLand06]))+nz([NetBldgAssess06])
)+nz([ResiRuralMill06])*(
nz([NetResiBldgAssess06])+nz([SumOfResidentialLand06])
+nz([SumOfRuralLand06])
)
)*0.001,2
)<1 and
Round(
(
nz([RuralMill06])*(
(nz([SumOfLand06]))+nz([NetBldgAssess06])
)+nz([ResiRuralMill06])*(
nz([NetResiBldgAssess06])+nz([SumOfResidentialLand06])
+nz([SumOfRuralLand06])
)
)*0.001,2
)>0
),1,iif(
Round(
(
nz([RuralMill06])*(
(nz([SumOfLand06])
)+nz([NetBldgAssess06])
)+nz([ResiRuralMill06])*(
nz([NetResiBldgAssess06])+nz([SumOfResidentialLand06])
+nz([SumOfRuralLand06])
)*0.001,2
)=0,0,IIf(
Round(
(
nz([RuralMill06])*(
(nz([SumOfLand06])
)+nz([NetBldgAssess06])
)+nz([ResiRuralMill06])*(
nz([RoundResiBldgAssess06])+nz([SumOfResiLand06])
+nz([SumOfRuralLand06])
)*0.001,2
)>1,Round(
(
nz([RuralMill06])*(
(nz([SumOfLand06]))+nz([NetBldgAssess06])
)+nz([ResiRuralMill06])*(
nz([NetResiBldgAssess06])+nz([SumOfResiLand06])
+nz([SumOfRuralLand06])
)
)*0.001,2
),'error'
)
)
)


.



Relevant Pages