![](https://www.csharp.com/forums/uploadfile/74bbef/08292022210821PM/image.png)
Check This Code
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[GetAttendanceLogweekly]AS
BEGINSET NOCOUNT ON;SELECT YEAR(dutydatetime) [Year], Count(1) [dutydatetime]
,COUNT(case when @@FETCH_STATUS ='Absent' then 1 end ) as Absent_Count
,Count (Case When @@FETCH_STATUS = 'Present' then 1 end ) as Present_Count
FROM tblattendancelog
GROUP BY YEAR(dutydatetime)
ORDER BY 1,2END
absent and present Count Diffrent Columns with