This is the query i am trying to solve
Create table Billing (Id int, Name varchar(50), Workhours Varchar(20),Description Varchar(50))
Declare @strdate int
Set @strdate =datepart(mm,getdate())-1
Select name,Sum(CAST(ROUND(Workhours, 0) AS int)) as [Workhours],Sum(CAST(ROUND(Workhours, 0) AS int))/40*100 as Billable from
Billing Where Id in(2,4,6,8) and Datepart(mm,workdate)=@strdate
group by name
Here i got the problem
It will take all the years including. I need a current year.
Can you please assist me?