วันนี้ เปิดโปรแกรมมา ตรวจสอบ Trx ดู หายหมดอีกแล้วครับท่าน
สิ่งที่ทำก่อนหน้านี้ คือเมื่อวานตอนเย็น clear replicate log กับใช้คำสั่งนี้ ในสายฟ้า เพื่อ export to excel มันเกี่ยวกันไหมครับ
select v.pttype,v.cid,concat(pt.pname,pt.fname,' ',pt.lname)as name,v.hn,v.vstdate,o.vsttime,
v.pdx,v.dx0,v.dx1,v.dx2,v.dx3,d.licenseno AS doctor,v.op0,v.op1,v.inc12 AS drug,v.inc01 AS lab,v.inc04 AS xray,v.inc06 AS opr,
v.inc14 AS others,v.income AS amt
from vn_stat v
left outer join pttype p on p.pttype = v.pttype
left outer join patient pt on pt.hn = v.hn
left outer join doctor d on d.code = v.dx_doctor
left outer join ovst o on o.vn=v.vn
where v.spclty <> 11 and v.pttype IN('04','34') and v.pdx <> "Z00" and v.pdx <> "Z000" and v.pdx <> "Z41" and v.pdx <> "O07"
and v.hospmain in ('10666','10891')
and v.pdx <> "K12*" and v.pdx <> "Z017" and v.pdx <> "Z008" and v.pdx not like "Z3%" and v.pdx not like "x6%" and v.pdx not like "x3%"
and v.vstdate between '2012-01-01' and '2012-01-31' and v.pdx not like "x8%" and v.pdx not like "Z0%" and v.pdx not like "K0%" and v.pdx not like "K1%"
and v.pdx not like "F11%" and v.pdx not like "F2%" and v.pdx not like "F5%" and v.pdx not like "F6%" and v.pdx not like "F7%" and v.pdx not like "F8%"
and v.pdx not like "F9%" and v.pdx not like "K0%" and v.pdx not like "K1%"
order by v.vstdate