I am new to SQL; the following code is supposed find comments that are not null on one day before the studydate.SELECT p.PatientID,P.LastName,P.FirstName,P.BirthTime,s.StudyDate,s.Modality,s.CommentsFROM Studies s INNER JOIN Patients pON s.PatientID = p.PatientIDWHERE s.Comments IS NOT NULLAND s.StudyDate >= CONVERT(char,DATEADD(day, -12, GETDATE()),101)AND s.StudyDate < CONVERT(char,DATEADD(day, -11, GETDATE()),101)
Is there a problem with this code? I expect there is because when I ran the query it didn't return any results even though I am positive there are comments in the database one day before the studydates.Any help would be greatly appreciatedThanks a ton,Regards-avery