IIF Condition

P

Pinacle

What is wrong with my iif condition below.

=IIF([text87]< 0,"0",[text87])

Access is giving me the following error message.

You omitted an operand or operator , You entered an invalid character or
comma, or you entered text without surrounding it in quotation marks. Please
help me find the problem.

Thanks.
 
J

John Spencer

Is the value in text87 a number type or is it text that consists of numbers.
You can try the following variants to see if they work.

=IIF([text87]< "0","0",[text87])

or

=IIF(Val([text87])< 0,"0",[text87])

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
P

Pinacle

Hi John,
I have tried both options but it is still throwing that error message.



John Spencer said:
Is the value in text87 a number type or is it text that consists of numbers.
You can try the following variants to see if they work.

=IIF([text87]< "0","0",[text87])

or

=IIF(Val([text87])< 0,"0",[text87])

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
What is wrong with my iif condition below.

=IIF([text87]< 0,"0",[text87])

Access is giving me the following error message.

You omitted an operand or operator , You entered an invalid character or
comma, or you entered text without surrounding it in quotation marks. Please
help me find the problem.

Thanks.
.
 
J

John Spencer

Where are you trying to use this?
Is this the source for a control?
What is the name of the control that this is the source for?

Is Text87 a field or is it the name of a control?



John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
Hi John,
I have tried both options but it is still throwing that error message.



John Spencer said:
Is the value in text87 a number type or is it text that consists of numbers.
You can try the following variants to see if they work.

=IIF([text87]< "0","0",[text87])

or

=IIF(Val([text87])< 0,"0",[text87])

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
What is wrong with my iif condition below.

=IIF([text87]< 0,"0",[text87])

Access is giving me the following error message.

You omitted an operand or operator , You entered an invalid character or
comma, or you entered text without surrounding it in quotation marks. Please
help me find the problem.

Thanks.
.
 
L

Lutz Uhlmann

Try ; instead of , !!!

Sometimes in the query editor access needs ; but in sql it is , again.
 
P

Pinacle

It worked...Thanks alot. Actually this happened because of my language
settings..my list seperator was changed to ';' insead of ','.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

invalid vertical bar 2
Expression using Iif with dates 5
DLookup syntax in control on form 7
iif Expression Error 5
IIF in Crosstab Expression 0
Header problem 0
Left function query error 2
Access 2000 BUG 2

Top