count the number of patients who have undergone a bands lab test until 2 years ago.
select count( distinct admissions.subject_id ) from admissions where admissions.hadm_id in ( select labevents.hadm_id from labevents where labevents.itemid in ( select d_labitems.itemid from d_labitems where d_labitems.label = 'bands' ) and datetime(labevents.charttime) <= datetime(current_time,'-2 year') )