luvtitans50
MIS
I have the below code:
select p.employeeid, sum (actualunits) as actualunits
from ss_hcsscsa.dbo.prchecktc t
inner join ss_hcsscsa.dbo.prcheckheader p (NOLOCK) on p.checkhistid = t.checkhistid
where t.paycodeid in (1,2,3,4,5,6,7) and checkdate between '2009-01-01' and '2009-12-31'
group by employeeid
Now what I need to do is list how many of the months out of the year had 1000 actualunits: count distinct months where sum (actualunits) = 1000
Any suggestions?
Thanks!!
select p.employeeid, sum (actualunits) as actualunits
from ss_hcsscsa.dbo.prchecktc t
inner join ss_hcsscsa.dbo.prcheckheader p (NOLOCK) on p.checkhistid = t.checkhistid
where t.paycodeid in (1,2,3,4,5,6,7) and checkdate between '2009-01-01' and '2009-12-31'
group by employeeid
Now what I need to do is list how many of the months out of the year had 1000 actualunits: count distinct months where sum (actualunits) = 1000
Any suggestions?
Thanks!!