is patient 24762 given medication until 40 months ago?
select count(*)>0 from prescriptions where prescriptions.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 24762 ) and datetime(prescriptions.startdate) <= datetime(current_time,'-40 month')