Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF Function

Status
Not open for further replies.

kristinac

Programmer
Jul 18, 2003
98
US
This is probably a stupid question, but I can't seem to find what I'm doing wrong. Here is my IIF statement:

SELECT...<misc stuff here>,
IIF((Segments.BStreetAddress) = 1, ' ' AS BAddress, Segments.BStreetAddress AS BAddress)

I'm getting a missing operator error.

Is it the space thing? Any ideas?

Thanks in advance...
 
Try this instead:

IIF((Segments.BStreetAddress) <> 1, Segments.BStreetAddress, ' ') AS BAddress


the IIF structure is:

Iif(condition, value if true, value if false)

you originally had make it blank if it's 1, I changed it to
if it's NOT 1 then use BStreetAddress, else put a blank, then the whole statement is AS BAddress.

Hope that helps (and works!)

Leslie


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top