Sql Doubt

FlavioT

New Member
Joined
Feb 11, 2003
Messages
40
Hi!
I have a doubt in my sql statement

It is very simple!

SELECT Loja.Loja, CC.Data, CC.Valor, Cartao.Cartão, CC.[ID Loja], CC.[ID CC]
FROM Loja INNER JOIN (Cartao INNER JOIN CC ON Cartao.[ID CC] = CC.[ID CC]) ON Loja.[ID Loja] = CC.[ID Loja];

What I need is

IF
[ID LOJA] <> 5 , 6 , 7 , 8 or 9

AND
[ID CC] = 4

the [CC.Valor] would show Zero...

How can I do This?? I tried do use an IIF statement but It did not work right! Please help!

:rolleyes:
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,221,814
Messages
6,162,132
Members
451,743
Latest member
matt3388

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