how many patients have been discharged from hospital until 2 years ago.
select count( distinct admissions.subject_id ) from admissions where admissions.dischtime is not null and datetime(admissions.dischtime) <= datetime(current_time,'-2 year')