BMS-HOSxP Community

HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: krathokman ที่ ตุลาคม 18, 2011, 11:21:39 AM

หัวข้อ: ขอ Sql Stetment ตามรูปครับ
เริ่มหัวข้อโดย: krathokman ที่ ตุลาคม 18, 2011, 11:21:39 AM
มีเรื่องรบกวนอีกแล้วครับ  ตามรูปครับ อยากได้ sql stetment ครับ เผื่อจะประยุกต์ใช้ในการออก Excel หรือเพิ่ม Field ที่อยากได้เช่น บัตรประชาชน ครับ
หัวข้อ: Re: ขอ Sql Stetment ตามรูปครับ
เริ่มหัวข้อโดย: niyomstd ที่ ตุลาคม 18, 2011, 11:24:27 AM
แบบนี้พอได้มั้ยครับ

select concat(p.pname,p.fname,' ',p.lname) as ptname,
v.*
from vn_stat v
left outer join patient p on p.hn=v.hn
left outer join pttype t on t.pttype=v.pttype
where v.vstdate between "2011-10-18"  and "2011-10-18"
and (v.paid_money>0 and v.rcpt_money=0)
order by v.vn
หัวข้อ: Re: ขอ Sql Stetment ตามรูปครับ
เริ่มหัวข้อโดย: เกื้อกูล ครับ.. ที่ ตุลาคม 18, 2011, 11:36:08 AM
คำถามซ้ำครับ...


  http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=23197.msg199093#new (http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=23197.msg199093#new)