when did patient 90165 enter the hospital first time until 4 years ago via the emergency room admit?
select admissions.admittime from admissions where admissions.subject_id = 90165 and admissions.admission_location = 'emergency room admit' and datetime(admissions.admittime) <= datetime(current_time,'-4 year') order by admissions.admittime asc limit 1