Expand|Select|Wrap|Line Numbers
- select case when adjAmount < 0 then 'No. of Negative Cases'
- when adjAmount > 0 then 'No. of Positive Cases'
- else 'No. of Null Cases'
- end as Report,procEndDate,
- count(adjAmount)
- from dbo.tblProductivity_HIS_DEV8
- where procEndDate between '2013-04' and '2014-04' and procstatus = 'Complete' and inventory = 'N'
- and (reportingBucketCategory = 'Audit' or
- (reportingBucketCategory = 'Services' and (adjAmount = 0.00 or adjAmount is null)) or
- (reportingBucketCategory is null and (adjAmount = 0 or adjAmount is null or adjAmount > 0)))
- group by case when adjAmount < 0 then 'No. of Negative Cases'
- when adjAmount > 0 then 'No. of Positive Cases'
- else 'No. of Null Cases'
- end,procEndDate
- order by procEndDate