I have basic query:
SELECT A.Username
,EH.[From]
,EH.[End]
,DATEDIFF(d, [From], [End]) AS HolidaysInDays
FROM EmployeHoliday EH
LEFT JOIN Admin A ON EH.UserId = A.AdminId
WHERE EH.IsActive = 1
If employee apply leave(LeaveStart = "17 Dec 2019" to LeaveEnd = "19 Dec 2019"), when I execute my query the output is HolidaysInDays = 2 but the actual Days is 3. So, how can I resolve this problem?
My output is as shown in the below image.