BMS-HOSxP Community
HOSxP => การเขียน SQL Script => ข้อความที่เริ่มโดย: Bluebird ที่ สิงหาคม 31, 2012, 09:48:26 AM
-
SQL Variable ค่า ล่าสุด ไม่ให้แสดง จุดทศนิยม
select concat(bps,"/",bpd) as bp
from opdscreen
where hn="0000002" order by vstdate desc limit 1
ตัวอย่างผลที่ได้ 123.000/86.000
อยากรู้ว่าต้องเพิ่มเงื่อนไขตรงไหนเพื่อที่จะให้ค่าที่ได้ เป็น 123/86 ครับ
-
ถ้า ใน Variable แบบนี้น่าจะได้
คลิกขวาที่ Variable ----> Calculation
แล้วทำตามกรอบสีแดงดูนะครับ
-
Value := getsqlstringdata('select bps from opdscreen where vn="'+dbpipeline['vn']+'" and bps>0 order by vn desc limit 1 ')+' / '+getsqlstringdata('select bpd from opdscreen where vn="'+dbpipeline['vn']+'" and bps>0 order by vn desc limit 1 ')