Jun 6th 2016, 20:49:21
SELECT Work.WorkID, Work.OpenedOn, Work.Name, Users.FirstName, Users.LastName, Users.TimekeeperID, Clients.ClientID FROM Work
inner join WorkUsers ON WorkUsers.[Work_id] = Work.[ID] INNER JOIN USERS ON Users.[ID] = WorkUsers.[User_Id]
INNER JOIN CLients ON Clients.[ID] = Work.Client_Id where WorkUsers.WorkUserType_Id = '1'
AND Work.[ID] not in (SELECT Work_Id FROM PartyToWorkRelationships) AND left(Work.WorkID,2) <> '80'
AND Work.CreatedOn > '2016-05-18'