If statement in Reporting Services

I'm trying to add the attached code to a Reporting Services Dataset.  
When I debug the code in SQL Server the error I get is...
   The isnull function requires 2 arguments..
Would you please show me what I'm doing wrong?  
SELECT  IIF (IsNull(YEAR(tblClientInExit.ReIntakeDate)),YEAR(tblClients.OriginalStartDate),YEAR(tblClientInExit.ReIntakeDate)) AS PlaceYear,
DATEPART(quarter, tblClients.OriginalStartDate) AS PlacePeriod, tblClients.OriginalStartDate, 
                      tblAddresses.CountyLkUpID, tblClientInExit.ReIntakeDate
FROM         tblClients INNER JOIN
                      tblAddresses ON tblClients.ClientFileNo = tblAddresses.ClientFileNo INNER JOIN
                      tblClientInExit ON tblClients.ClientFileNo = tblClientInExit.ClientFileNo
ORDER BY PlacePeriod, tblClientInExit.ReIntakeDate DESC

Open in new window

BobRosasAsked:
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.

Jason Yousef, MSSr. BI  DeveloperCommented:
IIF is a SSRS function and not a T-SQL one...
the T-sql equivalent is CASE

Also ISNULL is a T-sql function that uses 2 arguments, example:  Isnull('Year', 2011)  so here if the Year column is null I'm replacing with 2011

Read here about CASE
http://www.sql-server-performance.com/2006/iif-tsql/
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
BobRosasAuthor Commented:
Very helpful!  I got it working.  Thanks
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
SSRS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.