Dear Mr. Dharmendra Das,
Thank you for your answer
- For Column "DURATIONWORK" The result should be as per below
- For Column "LATE" This is not yet calculated
sample database ms access
ID NAMEID LOCATION DATE DAYS DEFAULTIN DEFAULTOUT DEFAULTREST STATUS IN OUT DURATIONWORK LATE INFO2
1000 JACK A 25-May-24 Saturday PRESENT 08:00 16:00 01:00:00 PRESENT 08:10:00 15:25:00 06:15:00 00:15:00
TRANSFORM Max(ABSEN.TIME) AS MaxOfTIME
SELECT ABSEN.ID,
MASTERID.NAMEID,
MASTERID.LOCATION,
ABSEN.[DATE],
FORMAT(ABSEN.DATE,'dddd') AS DAYS,
IIF(ABSEN.STATUS = "NO PRESENT", "", MASTERDAYS.DEFAULTIN) AS DEFAULTIN,
IIF(ABSEN.STATUS = "NO PRESENT", "",MASTERDAYS.DEFAULTOUT) AS DEFAULTOUT,
IIF(ABSEN.STATUS = "NO PRESENT", "",MASTERDAYS.DEFAULTREST) AS DEFAULTREST,
ABSEN.STATUS,
IIF(ABSEN.INFO2 = "NO WORK", ABSEN.INFO2,"") AS INFO2,
(CCur((DateDiff("n",MASTERDAYS.DEFAULTIN,MASTERDAYS.DEFAULTOUT)\6)/10)) AS DURATIONWORK
FROM (ABSEN INNER JOIN MASTERID ON ABSEN.ID = MASTERID.ID)
INNER JOIN MASTERDAYS MASTERDAYS ON MASTERDAYS.LOCATION = MASTERID.LOCATION
GROUP BY ABSEN.ID, MASTERID.NAMEID, MASTERID.LOCATION, ABSEN.[DATE], ABSEN.STATUS, ABSEN.INFO2, MASTERDAYS.DEFAULTIN, MASTERDAYS.DEFAULTOUT, MASTERDAYS.DEFAULTREST
PIVOT ABSEN.INOUT IN ('IN','OUT');