SSRS problem with mutli-value param and "expression of non-boolean type specified ..."
Posted on 2013-05-18
I'm getting an error of An expression of non-boolean type specified in a context where a condition is expected, near ','.
It's obviously to do with the multi-value param but I don't get why ?? it works with a single value but not multi ? Is it because the contractnumber is defined as int on the db ?
Here's the sql...
SELECT Count (job.scheduleddate) AS scheduled,
Count (job.datecompleted) AS completed
INNER JOIN jobline
ON job.id = jobline.jobid
INNER JOIN site
ON job.siteid = site.id
INNER JOIN contract
ON site.contractid = contract.id
INNER JOIN lift
ON jobline.liftid = lift.id
INNER JOIN company
ON contract.companyid = company.id
INNER JOIN systemuser
ON job.engineerid = systemuser.id
WHERE ( job.lookupjobtypeid = 9 )
AND ( job.lookupjobstatusid <> 7 )
AND ( job.scheduleddate BETWEEN @pStartDate AND Dateadd(mi, 1439,
AND ( lift.contractstatus = 1 )
AND ( jobline.lookupstatusid < 4 )
AND ( @pContract = -1
OR contract.contractnumber IN ( @pContract ) )
AND ( @pCompany = -1
OR company.id IN ( @pCompany ) )