I am trying to right a pretty simple SQL query and have run into a road block. I have a need to be able to see when we have rehired a former employee this year but have not had them get a drug test this calendar year yet. I know how to bring in records that have drug tests this year and in the past but I just can't figured out how have it show those employees hired that don't have anything for this year. Select Clause:select bHRDT.HRRef as [HRRef], bHRDT.Date as [Date], bHRDT.JCCo as [JCCo], bHRDT.Job as [Job], bHRDT.Location as [Location], bHRDT.TestStatus as [TestStatus], bHRDT.Results as [Results], bHRRM.PREmp as [PREmp], bHRRM.LastName as [LastName], bHRRM.FirstName as [FirstName], bHRRM.MiddleName as [MiddleName], bHRRM.Suffix as [Suffix],budHREmployeeHistory.DateStarted as [DateStarted]
Where Clause:FROM bHRDT (Nolock)JOIN bHRRM (Nolock) on bHRDT.HRCo = bHRRM.HRCo and bHRDT.HRRef = bHRRM.HRRefJOIN budHREmployeeHistory on bHRDT.HRRef=budHREmployeeHistory.Empwhere bHRDT.JCCo='1' and bHRRM.ActiveYN='Y' and budHREmployeeHistory.DateStarted > '2010-01-01 00:00:00' and budHREmployeeHistory.DateDischarged is null