SELECT
FirstName,
LastName,
CONVERT(VARCHAR(10), [Date], 101),
SUM(TimeSpent),
S.ProjectName,
S.UserId,
FROM [Project] AS S (NOLOCK)
INNER JOIN [User] AS U (NOLOCK) ON S.UserId = U.Id
WHERE S.LocationId = @LocationId
GROUP BY LastName, FirstName, ProjectName, CONVERT(VARCHAR(10), [Date], 101), UserId;
|