shah Momin

shah Momin

  • NA
  • 176
  • 21.4k

Sql Code edit please

Oct 25 2022 10:52 PM

 

 

     SELECT Count(type) FROM tblattendancelog WHERE dutydatetime>= DATEADD(day, DATEDIFF(day,0,getdate()), 0)
 

this uper line edit  down code me edit 

USE [BiometricDB]
GO
/****** Object:  StoredProcedure [dbo].[sp_GetTotalCountReport]    Script Date: 26/10/2022 03:28:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_GetTotalCountReport]
AS
BEGIN
-- Get Total Count Report
SELECT 
	[member].[Total Members], [onleave].[Total Onleave] ,[Present].[Total Present]
FROM
(
-- Total Memebers
	SELECT 
		COUNT(volunteerid) AS [Total Members], 1 AS [Id] 
	FROM 
		tblvolunteer 
	WHERE 
		[dateofleaving] = '' OR [dateofleaving] IS NULL
) [member] INNER JOIN
(
-- Total OnLeave
	SELECT 
		COUNT(leaverecordid) AS [Total Onleave], 1 AS [Id] 
	FROM 
		tblvolunteerleaverecord 
	WHERE 
		[todate] >= GETDATE()
) [onleave] ON [member].[Id] = [onleave].[Id]


END

Answers (2)