how many days has it been since patient 40707 has received the first prescription of d10w during their current hospital visit?
select 1 * ( strftime('%j',current_time) - strftime('%j',prescriptions.startdate) ) from prescriptions where prescriptions.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 40707 and admissions.dischtime is null ) and prescriptions.drug = 'd10w' order by prescriptions.startdate asc limit 1