Re: Access long expression - parenthsis problem
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Mon, 26 Feb 2007 14:53:46 -0500
Michelle wrote:
Hello,IIf(((Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]
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:
))+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.
.
- Follow-Ups:
- Re: Access long expression - parenthsis problem
- From: Michelle
- Re: Access long expression - parenthsis problem
- Prev by Date: Re: Handling Error in ADO
- Next by Date: Re: Access long expression - parenthsis problem
- Previous by thread: derived field problem
- Next by thread: Re: Access long expression - parenthsis problem
- Index(es):
Relevant Pages
|
|