im currently using the time clock but im having problem printing out the reports, is there a way that i can extract the info via the sql that will show the clockin/ clockout time and breaks with the total hours worked within the specified period so i can print out each employees time clock report…
Hey Lloyd we got your request please let us have some time to look at it… our team doesnt work on weekends typically. Time clock entries are in the database but our calculations are not.
2 Likes
i wanna implement this sql report to print when i choose the date range in the reports section
how do i go about it…
[TimeClock
Report:1,1,1,1,1, 1, 1,1]
>Name | ClockinDate | EarliestClockin | ClockoutDate | LatestClockout | TotalWork | TotalWage |
{REPORT SQL DETAILS:
SELECT
Name,
CONVERT(VARCHAR, ClockInDate, 101) AS ClockInDate,
CONVERT(VARCHAR, EarliestClockIn, 108) AS EarliestClockIn,
CONVERT(VARCHAR, ClockOutDate, 101) AS ClockOutDate,
CONVERT(VARCHAR, LatestClockOut, 108) AS LatestClockOut,
TotalWork,
TotalWage
FROM (
SELECT
Name,
CONVERT(DATE, MIN(ClockIn)) AS ClockInDate,
CONVERT(TIME, MIN(ClockIn)) AS EarliestClockIn,
CONVERT(DATE, MAX(ClockOut)) AS ClockOutDate,
CONVERT(TIME, MAX(ClockOut)) AS LatestClockOut,
CONCAT(
DATEDIFF(hour, MIN(ClockIn), MAX(ClockOut)),
'hr ',
DATEDIFF(minute, MIN(ClockIn), MAX(ClockOut)) % 60,
'mins'
) AS TotalWork,
SUM(TotalWage) AS TotalWage
FROM
dbo.TimeClockEntries
GROUP BY
Name
) AS ReportData
:F.Name,F.ClockInDate,F.EarliestClockIn,F.ClockOutDate,F.LatestClockOut,F.TotalWork,F.TotalWage::{0} |{1}|{2}|{3}|{4}|{5}|{6}
}