Re: Access long expression - parenthsis problem
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Mon, 26 Feb 2007 16:37:29 -0500
Keep going. Simplify it even more. Just make sure every expression you
replace with a letter is valid and works.
Wait. What you have does not seem to be a valid IIF expression, which is
supposed to have the form
Iif(test,truepart,falsepart)
What you have is more like:
Iif(stuff,1,morestuff,0,evenmorestuff)
This is guaranteed not to work.
Also, remember what i said about putting some whitespace in
.... 1and(Round ...
should be
.... 1 and (Round ...
Michelle wrote:
Hi Bob,IIf(((Round((X*((Y)+Z)+Q*(P+U+T))*0.001,2)<1and(Round((X*((Y)+Z)+Q*(P+U+
I simplified the expression, it may be clearer to look at. I am
desparate for help. Thanks a lot!
MajorRuralTax06:
T))*0.001,2)>0),1,
(Round((X*((Y)+Z)+Q*(P+U+T))*0.001,2)=0,0,IIf(Round((X*((Y)+Z)+Q*(W+V+T))*0.001,2)>1,Round((X*((Y)+Z)+Q*(P+V+T))*0
..001,2))))
IIf(((Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]
Michelle
"Bob Barrows [MVP]" wrote:
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:
ial))+nz([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResident
Land06])+nz([SumOfRuralLand06])))*0.001,2)<1and(Round((nz([RuralMill06])
*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nz([ResiRuralMill06])*(nz([
NetResiBldgAssess06])+nz([SumOfResidentialLand06])+nz([SumOfRuralLand06]
Net)))*0.001,2)>0),1,(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([
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])+
((Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nnz([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(
z([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResidentialLand
(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nz06])+nz([SumOfRuralLand06])))*0.001
,2)<1 and
([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResidentialLand0
,(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+n6])+nz([SumOfRuralLand06])))*0.001
,2)>0)
,1
z([ResiRuralMill06])*(nz([NetResiBldgAssess06])+nz([SumOfResidentialLand
,IIf(Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06])06])+nz([SumOfRuralLand06])))*0.001
,2)=0
,0
d06)+nz([ResiRuralMill06])*(nz([RoundResiBldgAssess06])+nz([SumOfResiLan
,Round((nz([RuralMill06])*((nz([SumOfLand06]))+nz([NetBldgAssess06]))+nz])+nz([SumOfRuralLand06])))*0.001
,2)>1
([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.
--
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.
.
- References:
- Re: Access long expression - parenthsis problem
- From: Bob Barrows [MVP]
- Re: Access long expression - parenthsis problem
- From: Michelle
- Re: Access long expression - parenthsis problem
- Prev by Date: Re: Access long expression - parenthsis problem
- Next by Date: Re: troubels with data access in windows 2000
- Previous by thread: Re: Access long expression - parenthsis problem
- Next by thread: Re: Access long expression - parenthsis problem
- Index(es):
Relevant Pages
|
|