ChangeDBPipeLineLink3SQL('select o.vn,concat(if((d.name is null or d.name = ""),"-",d.name)," ", '+
'if(d.strength is null,"",d.strength)," # ",[[/color]color=red]if(o.qty is null,"",o.qty)) as drug_name,[/color] '+
'concat(if((du.shortlist is null or du.shortlist = ""),"",du.shortlist), '+
'if((su.name1 is null or su.name1 = ""),"",su.name1),if((su.name2 is null or '+
'su.name2 = ""),"",su.name2),if((su.name3 is null or su.name3 = ""),"",su.name3)) as shortlist '+
'from opitemrece o '+
'left outer join drugitems d on d.icode = o.icode '+
'left outer join drugusage du on du.drugusage = o.drugusage '+
'left outer join sp_use su on su.sp_use = o.sp_use '+
'where o.icode like "1%" and o.vn = "'+DBPipeline['vn']+'" '+
'order by d.therapeuticgroup,d.name ');
ใน main report ตรงคสั่งข้างในสลับครังนี้ครับที่สีแดงเอามาไว้ข้างหน้าสีน้ำเงินครับ