Avatar of BobRosas
BobRosas

asked on 

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

SSRSMicrosoft SQL Server 2008

Avatar of undefined
Last Comment
BobRosas
ASKER CERTIFIED SOLUTION
Avatar of Jason Yousef
Jason Yousef
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of BobRosas
BobRosas

ASKER

Very helpful!  I got it working.  Thanks
Microsoft SQL Server 2008
Microsoft SQL Server 2008

Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the Always On technologies and support for unstructured data types.

50K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo