what was the last time patient 52018 was prescribed medications via ed route in 08/2104?
select prescriptions.startdate from prescriptions where prescriptions.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 52018 ) and prescriptions.route = 'ed' and strftime('%y-%m',prescriptions.startdate) = '2104-08' order by prescriptions.startdate desc limit 1