เวลาเรา clinck Next ปกติมันจะ show Data ที่ได้จาก SQL แต่ในกรณีนี้ "ไม่มี" แต่ถ้า Print ออกมาดูก็ได้ตามปกติ
ผมจะทำอย่างไรให้มัน Show ก่อน เพื่อให้เห้นว่ามีข้อมูลอะไรบ้างครับ
select r1.*,r1.name as HN,r1.name1 as Pt_Name,r1.name2 as Pt_Age,r1.name3 as FullAddress,r1.name4 as Sex,r1.date1 as BirthDay,
r2.name as Occupation,r2.name1 as MarryStatus,r2.name2 as Nationality,r2.name3 as Citizenship,r2.name4 as Religion,
r3.name as BloodGroup,r3.name1 as DrugAllergy,r3.name2 as HomeTel,r3.name3 as InformName,r3.name4 as InformAddr,
r4.name as InformRelation,r4.name1 as Father,r4.name2 as Mother,r4.name3 as SPSName,r4.name4 as CardName,
r5.name as CardCODE,r5.name1 as PtRight,r5.name2 as PtRightCode,r5.date1 as RightExpire,v.vn,concat(p.pname,p.fname) as namept,p.lname,p.bloodgroup_rh,a.an,p.hometel,p.drugallergy,p.bloodgrp,v.age_y,v.age_m,v.age_d,
v.vstdate,o.agent as drgallergy,o.symptom,pt.name as pttypename,concat(p.addrpart,"¹¹",p.road," ËÁÙè·Õè ",p.moopart," µ.",t3.name," Í.",t2.name," ¨.",t1.name) as fulladdressname
from tempreport r1
left outer join tempreport r2 on r2.reportname=r1.reportname and r2.id=r1.id and r2.num=2
left outer join tempreport r3 on r3.reportname=r1.reportname and r3.id=r1.id and r3.num=3
left outer join tempreport r4 on r4.reportname=r1.reportname and r4.id=r1.id and r4.num=4
left outer join tempreport r5 on r5.reportname=r1.reportname and r5.id=r1.id and r5.num=5
left outer join vn_stat v on r1.name = v.hn
left outer join patient p on r1.name=p.hn
left outer join an_stat a on a.vn=v.vn
left outer join opd_allergy o on o.hn=p.hn
left outer join ovst ov on ov.vn=v.vn
left outer join pttype pt on pt.pttype=ov.pttype
left outer join thaiaddress t1 on t1.chwpart=p.chwpart and
t1.amppart="00" and t1.tmbpart="00"
left outer join thaiaddress t2 on t2.chwpart=p.chwpart and
t2.amppart=p.amppart and t2.tmbpart="00"
left outer join thaiaddress t3 on t3.chwpart=p.chwpart and
t3.amppart=p.amppart and t3.tmbpart=p.tmbpart
where
r1.reportname="RB1T02" and r1.num=1
limit 2
ทำแบบนี้ใน สายฟ้าก่อนครับ แล้ว copy ในส่วน ID มาวางแทนที่ ตามสีแดงครับ
r1.id="
ID-{2919F1A3-8598-4843-93DF-1197DFB64E87}" and
r2.id="
ID-{2919F1A3-8598-4843-93DF-1197DFB64E87}" and
r3.id="
ID-{2919F1A3-8598-4843-93DF-1197DFB64E87}" and
r4.id="
ID-{2919F1A3-8598-4843-93DF-1197DFB64E87}" and
r5.id="
ID-{2919F1A3-8598-4843-93DF-1197DFB64E87}" and
r1.reportname="RB1T02" and r1.num=1