I am getting the error message, "An expression of non-boolean type specified in a context where a condition is expected, near ',' " when running an ssrs 2008 r2 report.
The sql embedded in the dataset is:
IF @reportID <> 0
BEGIN
SELECT 'Students report 1' AS selectRptName, 1 AS rptNumValue
UNION
SELECT 'Students report 2', 2
UNION
SELECT 'Students report 3', 3
UNION
SELECT 'Students report 4', 4
UNION
SELECT 'Students report 5', 5
ORDER BY selectRptName
END
)
The sql runs fine in managment studio when I declare @reportID.
The sql runs fine with I comment out 'IF @reportID <> 0'.
The @reportID is a parmeter value that is passed to the applicable dataset.
The @reportID can have more than one value.
Thus can you show me sql and/or tell me what I need to do to solve the issue for me?