BMS-HOSxP Community
HOSxP => Report Exchange => ข้อความที่เริ่มโดย: Tang ที่ ธันวาคม 29, 2009, 11:36:13 AM
-
ขอความช่วยเหลือ รายงานหัตถการผู้ป่วยนอกหน่อยครับ คือผมลองทำแล้วมันไม่ยอมรวมให้อ่าครับ
แต่รายงานมันจะออกมาเป็นราย ๆ
select o.* ,d.name as doctor_name ,e.name as operation_name,v.hn as hn ,concat(p.pname,p.fname," ",p.lname) as patient_name
from doctor_operation o,doctor d , er_oper_code e , ovst v ,patient p
where d.code = o.doctor and e.er_oper_code = o.er_oper_code and o.vn = v.vn and v.hn = p.hn
and v.vstdate between "2009-01-01" and "2009-12-31"
หรือว่าผมดึงคำสั่งผิดครับ
หน้าตารายงานตามไฟล์ที่แนบอ่าครับ
-
ลอง select * from er_oper_code แล้วที่เหลือก็ใช้ Variable count เอาก็ได้ครับ
หรือถ้าจะเอาเฉพาะหัตการบางตัวก็
select * from er_oper_code where er_oper_code in ("xx","xx")
-
ขอบคุณมาก ๆ ครับ อ.Imnuke ผมมาปรับใส่แล้ว OK มากครับ
-
post ให้โหลดหน่อยสิคะ
ขอบคุณล่วงหน้า