I have created the following query.
DECLARE @StartDate Datetime = '2014-11-01' , @EndDate DateTime = '2014-12-01' SELECT Appointments.ApptStart, Appointments.Status, DoctorFacility.Last, DoctorFacility.First, PatientVisit.PatientVisitId, PatientVisit.PatientProfileId FROM DoctorFacility, PatientVisit left join Appointments ON Appointments.PatientVisitID=PatientVisit.PatientvisitID where (DoctorFacility.Last = 'Cambell') OR (DoctorFacility.Last = 'Frost') OR (DoctorFacility.Last = 'Maden') OR (DoctorFacility.Last = 'Morell') OR (DoctorFacility.Last = 'Schott') AND (Appointments.Status like 'Cancel%' )
However, the query is pulling all status from the Appointments.Status column instead of Cancel. I have tried both like as well as equal. Same results. What am I doing wrong?