Is there "IIF" in the SQL dialect of MS-SQL server?

I tried to use "IIF" in the SQL statments of the MS-SQL server 6.5 but the interpreter didn't accept it although it exists in for example MS-Access Dialect is there any function replaces the "IIF" or the "IIF"  idea is inhibited completelly in the server.
Can anyone tell me if I'm wrong in its usage or another way to accomplish its function "rather than adding more tables to the database"

Thanks for help.
WaelEgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

crsankarCommented:
You cannot use the iif statement in SQL Server. You can use CASE instead.

here is an example.

USE pubs

GO

SELECT      Category =
            CASE type
                  WHEN 'popular_comp' THEN 'Popular Computing'
                  WHEN 'mod_cook' THEN 'Modern Cooking'
                  WHEN 'business' THEN 'Business'
                  WHEN 'psychology' THEN 'Psychology'
                  WHEN 'trad_cook' THEN 'Traditional Cooking'
                  ELSE 'Not yet categorized'
            END,
      CAST(title AS varchar(25)) AS 'Shortened Title',
      price AS Price
FROM titles
WHERE price IS NOT NULL
ORDER BY type, price
COMPUTE AVG(price) BY type
GO
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WaelEgAuthor Commented:
Thank you very much I'm still trying at the real project but it worked on an example.
Thanks again.
God guides all of us to the right path.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.