Project

General

Profile

Bug #1990 » CBKTTMTOPYATTUANGMAKAN.sql

Tri Rizqiaty, 02/15/2023 11:15 AM

 
1
CREATE PROCEDURE CBKTTMTOPYATTUANGMAKAN
2
(
3
	@EmployeeID VARCHAR(20)
4
	,@StartDate VARCHAR(20)
5
	,@EndDate VARCHAR(20)
6
	,@AttendanceType VARCHAR(20)
7
)
8
AS
9

    
10
--DECLARE @EmployeeID VARCHAR(20) = '00001000'
11
--DECLARE @StartDate VARCHAR(20) = '20230130'
12
--DECLARE @EndDate VARCHAR(20) = '20230205'
13
--DECLARE @AttendanceType VARCHAR(20) = '1000'
14

    
15
SELECT DISTINCT EmployeeID, COUNT(StartDate) AS TotAttendance FROM dbo.PHRPA0019
16
WHERE EmployeeID = @EmployeeID 
17
AND (StartDate BETWEEN @StartDate AND @EndDate)
18
AND AttendanceType = '1000'
19
GROUP BY EmployeeID
(3-3/4)