Fixed a problem in the sql query for the timesheet.