Why is this querie returning me an error (#error):

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Why is this querie returning me an error (#error):

IIf([NewThickRectas]<Nz(([NewCompactacaoRectasUMin]/1000);[NewThickRectas])
Or
[NewThickRectas]>Nz(([NewCompactacaoRectasUMax]/1000);[NewThickRectas]);"*" &
[NewThickRectas] &
"*";IIf([NewThickRectas]<nz(([NewCompactacaoRectasMin]/1000);[NewThickRectas])
Or [NewThickRectas]>Nz(([NewCompactacaoRectasMax]/1000);[NewThickRectas]);"*"
&
[NewThickRectas];IIf([NewThickRectas]>=Nz(([NewCompactacaoRectasMin]/1000);[NewThickRectas])
Or
[NewThickRectas]<=Nz(([NewCompactacaoRectasMax]/1000);[NewThickRectas]);[NewThickRectas])))

Regards;
Marco
 
You can't use OR statements within an IIf like that. While it's possible to
next IIf statements, you have to be very, very careful if more than one can
be true.

Also you have a lot of semi-colons. Arguments need to be seperated with
commas.

An IIf statement requires three arguments: The expression, what to do if
true, what to do if false.

IIf(expr, truepart, falsepart)

IIf([NewThickRectas]<Nz([NewCompactacaoRectasUMin]/1000),[NewThickRectas],
"0")
 
Hi Jerry.

Well in portugal we use ; instead of commas.

My problem is that I have to compare my values with some standards. If my
standard values were in a table the query worked ok, but I was forced to put
my standards in a querie because I had to remove zeros.

Now the querie is not working.


My problem is this: (Please help if you can.)

http://www.microsoft.com/communitie...ries&mid=b65d19b3-444a-4aee-92f1-d3ac845e083d

Hope you can help.

Regards,
Marco














Jerry Whittle said:
You can't use OR statements within an IIf like that. While it's possible to
next IIf statements, you have to be very, very careful if more than one can
be true.

Also you have a lot of semi-colons. Arguments need to be seperated with
commas.

An IIf statement requires three arguments: The expression, what to do if
true, what to do if false.

IIf(expr, truepart, falsepart)

IIf([NewThickRectas]<Nz([NewCompactacaoRectasUMin]/1000),[NewThickRectas],
"0")
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

Marco said:
Why is this querie returning me an error (#error):

IIf([NewThickRectas]<Nz(([NewCompactacaoRectasUMin]/1000);[NewThickRectas])
Or
[NewThickRectas]>Nz(([NewCompactacaoRectasUMax]/1000);[NewThickRectas]);"*" &
[NewThickRectas] &
"*";IIf([NewThickRectas]<nz(([NewCompactacaoRectasMin]/1000);[NewThickRectas])
Or [NewThickRectas]>Nz(([NewCompactacaoRectasMax]/1000);[NewThickRectas]);"*"
&
[NewThickRectas];IIf([NewThickRectas]>=Nz(([NewCompactacaoRectasMin]/1000);[NewThickRectas])
Or
[NewThickRectas]<=Nz(([NewCompactacaoRectasMax]/1000);[NewThickRectas]);[NewThickRectas])))

Regards;
Marco
 
Back
Top