count the number of patients who have been admitted to the hospital until 2 years ago.
select count( distinct admissions.subject_id ) from admissions where datetime(admissions.admittime) <= datetime(current_time,'-2 year')