Link to home
Start Free TrialLog in
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

ASKER CERTIFIED SOLUTION
Avatar of Jason Yousef
Jason Yousef
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BobRosas
BobRosas

ASKER

Very helpful!  I got it working.  Thanks