Re: Access long expression - parenthsis problem



Michelle wrote:
Hello,

My long expression has driven me crazy for the past few days. there
are too many parenthsises. I need someone with clearer mind to help.
The message is 'The expression you entered is missing a closing
parenthesis, bracket(]), or vertical bar'. Your help would be highly
appreciated.

The basis of this expression is: iif([x]<1 and
[x]>0,=1,iif[x]=0,0,iif[x]>1,calculated value)

MajorRuralTax06:

IIf(((Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]
))+nz([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResidential
Land06])+nz([SumOfRuralLand06])))*0.001,2)<1and(Round((nz([RuralMill06])
*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nz([ResiRuralMill06])*(nz([
NetResiBldgAssess06])+nz([SumOfResidentialLand06])+nz([SumOfRuralLand06]
)))*0.001,2)>0),1,(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([Net
BldgAssess06]))+nz([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([Sum
OfResidentialLand06])+nz([SumOfRuralLand06])))*0.001,2)=0,0,IIf(Round((n
z([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nz([ResiRur
alMill06])*(nz([RoundResiBldgAssess06])+nz([SumOfResiLand06])+nz([SumOfR
uralLand06])))*0.001,2)>1,Round((nz([RuralMill06])*((nz([SumOfLand06]))+
nz([NetBldgAssess06]))+nz([ResiRuralMill06])*(nz([NetResiBldgAssess06])+
nz([SumOfResiLand06])+nz([SumOfRuralLand06])))*0.001,2))))

Well, I'm not going to tackle it, but if i was, I would start by
inserting a line break before each comma to get this:

IIf(
((Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+n
z([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResidentialLand
06])+nz([SumOfRuralLand06])))*0.001
,2)<1 and
(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nz
([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResidentialLand0
6])+nz([SumOfRuralLand06])))*0.001
,2)>0)
,1
,(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+n
z([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResidentialLand
06])+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)))
)

Add some whitespace to make the mess more readable and apply some
indentation. Replace complicated sections of the expression with
keywords (which you will replace with the actual expressions later on
after you have the parentheses correct)
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


.



Relevant Pages

  • Re: Access long expression - parenthsis problem
    ... it may be clearer to look at. ... My long expression has driven me crazy for the past few days. ... are too many parenthsises. ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • Re: Access long expression - parenthsis problem
    ... Simplify it even more. ... are too many parenthsises. ... Please reply to the newsgroup. ... a quicker response by posting to the newsgroup. ...
    (microsoft.public.data.ado)
  • Re: Access long expression - parenthsis problem
    ... What you have does not seem to be a valid IIF expression, ... are too many parenthsises. ... Please reply to the newsgroup. ... a quicker response by posting to the newsgroup. ...
    (microsoft.public.data.ado)