
DECLARE @nip VARCHAR(10)

DECLARE list_cursor CURSOR FOR  
SELECT DISTINCT NIP FROM SPG_REPORT_ABSENSI WHERE TANGGAL_ABSEN = 20230814 AND (
		MOBILE_MASUK_LOC LIKE '%,%'
		OR MOBILE_KELUAR_LOC LIKE '%,%'
		)

OPEN list_cursor  
FETCH NEXT FROM list_cursor INTO @nip  

WHILE @@FETCH_STATUS = 0  
BEGIN  

	EXEC usp_proses_presensi_pegawai @nip, '2023-08-14'

	FETCH NEXT FROM list_cursor INTO @nip  
END  

CLOSE list_cursor  
DEALLOCATE list_cursor 


