akins4lyfe
Programmer
i have designed a crosstab query from a table with fields containing DATETIME datatype, to produce a report showing employee start time, and end time, for sets of specified dates, e.g "Current Week".
here is my query:
TRANSFORM Sum(Format([Logout Time]-[Login Time],"h")) AS HoursWorked
SELECT [First Name] & " " & [Last Name] AS [Agent Name], Sum([HoursWorked]) AS [Total Hours]
FROM tblEmployee INNER JOIN tblTimeSheet ON tblEmployee.[LAN ID] = tblTimeSheet.[LAN ID]
WHERE (((Year([Date])*"53"+DatePart("ww",[Date]))=Year(Date())*"53"+DatePart("ww",Date())-1))
GROUP BY [First Name] & " " & [Last Name]
PIVOT tblTimeSheet.Date;
Hours Worked is rounding up to a whole number, like 4 hours, i would like to display hours and minutes for example 4hrs:45min. And also to label the column heads with Weekdays e.g Monday, Tuesday e.t.c.
Could someone pls point me in the right direction. Thanks.
here is my query:
TRANSFORM Sum(Format([Logout Time]-[Login Time],"h")) AS HoursWorked
SELECT [First Name] & " " & [Last Name] AS [Agent Name], Sum([HoursWorked]) AS [Total Hours]
FROM tblEmployee INNER JOIN tblTimeSheet ON tblEmployee.[LAN ID] = tblTimeSheet.[LAN ID]
WHERE (((Year([Date])*"53"+DatePart("ww",[Date]))=Year(Date())*"53"+DatePart("ww",Date())-1))
GROUP BY [First Name] & " " & [Last Name]
PIVOT tblTimeSheet.Date;
Hours Worked is rounding up to a whole number, like 4 hours, i would like to display hours and minutes for example 4hrs:45min. And also to label the column heads with Weekdays e.g Monday, Tuesday e.t.c.
Could someone pls point me in the right direction. Thanks.