sql query updated to fetch existing timesheets