IFF statement in microsoft query

Pepino

New Member
Joined
Apr 6, 2018
Messages
2
I'd like to use funkcion IIF in microsoft query ODBC database .
I wrote "IIF(resn70='4';0;lqty70*litr35/iscf35/100)"
Bat a message appears "SQL0104-Token = is not valid"
Please help
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi,

The error says SQL0104-Token = is not valid.
The only part where you're using the = sign is creating the error.

Have you tried to double quote instead of single ones, like this: IIF(resn70="4";0;lqty70*litr35/iscf35/100)
 
Upvote 0
Hi Joris,
I tried to use double quote in a couple of times. The same message is still showing "SQL0104-Token = is not valid. Valid tokens :,. "
I'm not so sure if IIF can be used in microsoft query ??? It does not have any other solution that will do the same??? :cool:
 
Upvote 0
IIF should be fine.

Syntax I'm familiar with has only ever been : IIF(resn70='4',0,lqty70*litr35/iscf35/100)
That is, comma separators between arguments.

Also in case relevant, the '4' is only suitable for a text field. I'm wondering if resn70 is a numeric field?
If so, try IIF(resn70=4,0,lqty70*litr35/iscf35/100)

 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top