SQL If Statments in Access

J

Jacques

I have an Access table that I need to get data from three
different fields depending on another field being
populated. Does Access have SQL code similar to If
statments or decode statments?
 
R

Rick Brandt

Jacques said:
I have an Access table that I need to get data from three
different fields depending on another field being
populated. Does Access have SQL code similar to If
statments or decode statments?

Immediate-If
IIf(SomeTest, ReturnIfTrue, ReturnIfFalse)

or the Switch() Function.
Switch(FirstTest, ReturnIfTrue, SecondTest, ReturnIfTrue, etc..)
 
V

Van T. Dinh

Check Access VB Help on the IIf (Immediate If) function.

HTH
Van T. Dinh
MVP (Access)
 

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

Top