SELECT
visit.pcucode,
visit.visitno,
visit.visitdate,
visit.pcucodeperson,
visit.pid,
visit.timeservice,
visit.timestart,
visit.timeend,
visit.rightcode,
visit.rightno,
visit.hosmain,
visit.hossub,
visit.incup,
visit.symptoms,
visit.vitalcheck,
visit.weight,
visit.height,
visit.pressure,
visit.pressurelevel,
visit.temperature,
visit.pulse,
visit.respri,
visit.waist,
visit.ass,
visit.screenotherdisease,
visit.alivestatus,
visit.healthsuggest1,
visit.healthsuggest2,
visit.healthsuggesttype,
visit.receivepatient,
visit.receivefromhos,
visit.refer,
visit.refertohos,
visit.referback,
visit.referbackdate,
visit.locateservice,
visit.money1,
visit.money2,
visit.money3,
visit.moneynoclaim,
visit.username,
visit.flagservice,
visit.usernamecancel,
visit.flag18fileexpo,
visit.bmilevel,
visit.dateupdate,
visit.numberreceive,
visit.numberrefer,
visit.servicetype,
visit.pressure2,
visit.pressurelevel2,
visit.flagoffline,
visit.doccounseling,
visit.dentprojectcode,
visit.gaheent,
visit.gahlart,
visit.galung,
visit.gaab,
visit.gaext,
visit.ganeuro,
visit.smokingyr,
visit.giveupsmoking,
visit.alcoholyr,
visit.giveupalcoholyr,
visit.exameyel,
visit.exameyer,
visit.referidprovince,
visit.diagnote,
visitdrug.drugcode
FROM
visit
INNER JOIN visitanc ON visit.visitno = visitanc.visitno
INNER JOIN visitdrug ON visitanc.visitno = visitdrug.visitno
INNER JOIN cdrug ON cdrug.drugcode = visitdrug.drugcode
where visit.visitdate BETWEEN '2014-10-01' AND '2015-09-30' and left(cdrug.drugcode24,19) IN ('2011101000199999203','2011203200377262217','2020301200199999203')
