BMS-HOSxP Community

HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: MR.KRAPONG<> ที่ สิงหาคม 08, 2011, 11:13:59 AM

หัวข้อ: ช่วยดูคำสั่งนี้ให้หน่อยครับ
เริ่มหัวข้อโดย: MR.KRAPONG<> ที่ สิงหาคม 08, 2011, 11:13:59 AM
select i.dchdate, i.regdate,p.hn,rd.an,concat(trim(p.pname),trim(p.fname), "  ",trim(p.lname)) as ptname, pt.name, ovst.hospmain ,concat(hospcode.hosptype,hospcode.name) as hname,  Sum(rd.sum_price) AS price,  a.paid_money, a.uc_money,a.remain_money ,discount_money ,rcpt_money,item_money,rcpno_list
from opitemrece rd
left outer join  patient p on p.hn = rd.hn
left outer join  an_stat a on a.an = rd.an
left outer join ipt i on i.an = a.an
left outer join  pttype pt on i.pttype = pt.pttype
left outer join  ovst on a.an = ovst.an
left outer join hospcode on ovst.hospmain = hospcode.hospcode
where a.dchdate between "2010-05-01" and "2010-05-31"
group by rd.an, pt.pttype
order by i.dchdate, pt.pttype
เพิ่มเลข13 หลัก

select vst.vstdate,vst.vn,vst.hn,concat(trim(pt.pname),trim(pt.fname), "  ",trim(pt.lname)) as ptname,ptt.name as pttypename , vst.hospmain,
concat(hc.hosptype,hc.name) as hname,vst.income,vst.paid_money,vst.rcpno_list
 from vn_stat vst
 left outer join patient pt on vst.hn=pt.hn
 left outer join pttype ptt on vst.pttype=ptt.pttype
 left outer join hospcode hc on vst.hospmain = hc.hospcode 
 where vst.vstdate between '2010-05-01' and '2010-05-02'
 order by vst.vstdate,vst.pttype
ถ้าจะเพิ่มเลข 13 หลัก จะต้องแทรกยังไงครับ
หัวข้อ: Re: ช่วยดูคำสั่งนี้ให้หน่อยครับ
เริ่มหัวข้อโดย: Bond_007 ที่ สิงหาคม 08, 2011, 11:22:20 AM
select i.dchdate, i.regdate,p.hn,p.cid,rd.an,concat(trim(p.pname),trim(p.fname), "  ",trim(p.lname)) as ptname, pt.name, ovst.hospmain ,concat(hospcode.hosptype,hospcode.name) as hname,  Sum(rd.sum_price) AS price,  a.paid_money, a.uc_money,a.remain_money ,discount_money ,rcpt_money,item_money,rcpno_list
from opitemrece rd
left outer join  patient p on p.hn = rd.hn
left outer join  an_stat a on a.an = rd.an
left outer join ipt i on i.an = a.an
left outer join  pttype pt on i.pttype = pt.pttype
left outer join  ovst on a.an = ovst.an
left outer join hospcode on ovst.hospmain = hospcode.hospcode
where a.dchdate between "2010-05-01" and "2010-05-31"
group by rd.an, pt.pttype
order by i.dchdate, pt.pttype
หัวข้อ: Re: ช่วยดูคำสั่งนี้ให้หน่อยครับ
เริ่มหัวข้อโดย: Bond_007 ที่ สิงหาคม 08, 2011, 11:30:16 AM
อีกอันครับ ผมก็ไม่เก่งเท่าไหร่นะครับ
select vst.vstdate,vst.vn,vst.hn,vst.cid,concat(trim(pt.pname),trim(pt.fname), "  ",trim(pt.lname)) as ptname,ptt.name as pttypename , vst.hospmain,
concat(hc.hosptype,hc.name) as hname,vst.income,vst.paid_money,vst.rcpno_list
 from vn_stat vst
 left outer join patient pt on vst.hn=pt.hn
 left outer join pttype ptt on vst.pttype=ptt.pttype
 left outer join hospcode hc on vst.hospmain = hc.hospcode 
 where vst.vstdate between '2010-05-01' and '2010-05-02'
 order by vst.vstdate,vst.pttype
หัวข้อ: Re: ช่วยดูคำสั่งนี้ให้หน่อยครับ
เริ่มหัวข้อโดย: MR.KRAPONG<> ที่ สิงหาคม 08, 2011, 11:41:01 AM
select i.dchdate, i.regdate,p.hn,p.cid,rd.an,concat(trim(p.pname),trim(p.fname), "  ",trim(p.lname)) as ptname, pt.name, ovst.hospmain ,concat(hospcode.hosptype,hospcode.name) as hname,  Sum(rd.sum_price) AS price,  a.paid_money, a.uc_money,a.remain_money ,discount_money ,rcpt_money,item_money,rcpno_list
from opitemrece rd
left outer join  patient p on p.hn = rd.hn
left outer join  an_stat a on a.an = rd.an
left outer join ipt i on i.an = a.an
left outer join  pttype pt on i.pttype = pt.pttype
left outer join  ovst on a.an = ovst.an
left outer join hospcode on ovst.hospmain = hospcode.hospcode
where a.dchdate between "2010-05-01" and "2010-05-31"
group by rd.an, pt.pttype
order by i.dchdate, pt.pttype

อีกอันละครับ
หัวข้อ: Re: ช่วยดูคำสั่งนี้ให้หน่อยครับ
เริ่มหัวข้อโดย: MR.KRAPONG<> ที่ สิงหาคม 08, 2011, 11:56:13 AM
ผมเอาไปใส่ในฟอร์มรายงานแล้วมันขึ้นยังงี้ครับ
หัวข้อ: Re: ช่วยดูคำสั่งนี้ให้หน่อยครับ
เริ่มหัวข้อโดย: jdadmin1 ที่ สิงหาคม 08, 2011, 12:06:15 PM
 ;D ;D ;D แก้คำสั่งตรงที่มาร์คไว้นี้ ;D ;D ;D

หัวข้อ: Re: ช่วยดูคำสั่งนี้ให้หน่อยครับ
เริ่มหัวข้อโดย: MR.KRAPONG<> ที่ สิงหาคม 08, 2011, 12:14:45 PM
;D ;D ;D แก้คำสั่งตรงที่มาร์คไว้นี้ ;D ;D ;D



ขอบคุณครับ
หัวข้อ: Re: ช่วยดูคำสั่งนี้ให้หน่อยครับ
เริ่มหัวข้อโดย: Bond_007 ที่ สิงหาคม 08, 2011, 12:41:03 PM
ได้หรือยังครับ  :D
;D ;D ;D แก้คำสั่งตรงที่มาร์คไว้นี้ ;D ;D ;D



ขอบคุณครับ
หัวข้อ: Re: ช่วยดูคำสั่งนี้ให้หน่อยครับ
เริ่มหัวข้อโดย: MR.KRAPONG<> ที่ สิงหาคม 08, 2011, 12:52:29 PM
ได้หรือยังครับ  :D
;D ;D ;D แก้คำสั่งตรงที่มาร์คไว้นี้ ;D ;D ;D



ขอบคุณครับ
กำลังลองทำอยู่ครับ