ALTER procedure getattrecord( @month int, @year int ) as begin create table #temp(staffid varchar(10),attstatus char(1)) insert into #temp (select staffid,mrngstatus from demo_tbl where mrngstatus='P' and YEAR(date)=@year and MONTH(date)=@month) union all (select staffid,evngstatus from demo_tbl where evngstatus='P' and YEAR(date)=@year and MONTH(date)=@month) select staffid,cast(count(*) as float) /2 from #temp group by staffid end
Declare @temp table( staffid varchar(10), attstatus char(1) )
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)