SELECT * FROM BPS_Patients p WHERE p.statustext = 'Active' AND p.internalid IN (SELECT a.internalid FROM appointments a INNER JOIN appointmenttypes apt ON a.appointmenttype = apt.appointmentcode WHERE apt.[description] LIKE '%Covid 1st Dose%' -- Add your appointment type inbetween the two percentage signs AND a.appointmentdate >= Getdate() AND a.recordstatus = 1) AND p.dob > Dateadd(year, -60, Getdate())