USE [OJK SMARTHR]

SELECT 
	nip, 
	time_presensi, 
	term_id, 
	DATEADD(hour, -5, time_presensi) AS time_presensi_new, 
	replace(term_id, ',', '.') AS term_id_new
FROM 
	Presensis
WHERE
	time_presensi >= '2023-08-14 11:00:00'
	AND SUBSTRING(term_id, 5, 1) = ','

--UPDATE
--	Presensis
--SET
--	time_presensi = DATEADD(hour, -5, time_presensi),
--	term_id = replace(term_id, ',', '.')
--WHERE
--	time_presensi >= '2023-08-14 11:00:00'
--	AND SUBSTRING(term_id, 5, 1) = ','
-- (1054 rows affected)

--SELECT * INTO Presensis_20230814 FROM Presensis
--SELECT * FROM Presensis_20230814
SELECT * FROM Presensis WHERE time_presensi >= '2023-08-14 11:00:00'

--SELECT * INTO Presensis_20230814_0850 FROM Presensis
--UPDATE
--	Presensis
--SET
--	time_presensi = DATEADD(hour, -5, time_presensi),
--	term_id = replace(term_id, ',', '.')
--WHERE
--	time_presensi >= '2023-08-14 11:00:00'
--	AND SUBSTRING(term_id, 5, 1) = ','
-- (85 rows affected)



SELECT 
	*
FROM 
	Presensis
WHERE
	time_presensi >= '2023-08-14 00:00:00'
	--AND SUBSTRING(term_id, 5, 1) = ','
	AND nip IN ('04494')
ORDER BY
	id, nip
SELECT 
	*
FROM 
	Presensis
WHERE
	time_presensi >= '2023-08-14 00:00:00'
	--AND SUBSTRING(term_id, 5, 1) = ','
	AND nip IN ('01522')
ORDER BY
	id, nip