BMS-HOSxP Community
HOSxP => MySQL => ข้อความที่เริ่มโดย: nuayny ที่ กรกฎาคม 26, 2009, 16:20:33 PM
-
ต้องการรวมค่าของ Variable1 กับ Variable2 ต้องใชคำสัง่ใหนครับ รบกวนท่านผู้รู้ช่วยสั่งสอนด้วยครับ....
ชื่อโรค ชาย หญิง รวม
K018 3 14 ? รวมไม่เป็นครับไม่รู้ใช้คำสั่งอะไร
....ขอบคุณครับ.....
-
Value := Variable1.Value + Variable2.Value
อย่าลืมเปลี่ยน Data type ให้เป็นตัวเลขด้วยนะครับ ถ้าเป็น String มันจะเอาตัวเลขมาต่อกัน
-
Value := Variable1.Value + Variable2.Value
อย่าลืมเปลี่ยน Data type ให้เป็นตัวเลขด้วยนะครับ ถ้าเป็น String มันจะเอาตัวเลขมาต่อกัน
เปลี่ยนตรงใหนครับ (เปลี่ยน DATATYPE)แล้วมำอย่างไรครับ...รอคำตอบอยู่ครับ ขอบคุณครับ
-
ลองแล้วไม่ได้ครับ......ช่วยหน่อยครับ
Variable1 ====>
Value := GetSQLIntegerData('select count(*) from ovstdiag c left outer join vn_stat v on v.vn=c.vn where c.icd10="K081" and c.vstdate between "'+ds1+'" and "'+ds2+'" and v.sex="1"');
Variable2 ====>
Value := GetSQLIntegerData('select count(*) from ovstdiag c left outer join vn_stat v on v.vn=c.vn where c.icd10="K081" and c.vstdate between "'+ds1+'" and "'+ds2+'" and v.sex="2"');
Variable3
Value := Variable1.Value + Variable2.Value
ผลที่ได้
ชื่อโรค ชาย หญิง รวม
K018 3 14 314
-
Value := variable1.asinteger+variable2.asinteger
แบบนี้ไหมครับ อย่าลืมเปลี่ยน variable ทุกตัวให้เป็น Integer ละครับ
-
Value := Variable1.Value + Variable2.Value
อย่าลืมเปลี่ยน Data type ให้เป็นตัวเลขด้วยนะครับ ถ้าเป็น String มันจะเอาตัวเลขมาต่อกัน
เปลี่ยนตรงใหนครับ (เปลี่ยน DATATYPE)แล้วมำอย่างไรครับ...รอคำตอบอยู่ครับ ขอบคุณครับ
ตามรูป ครับ
-
ได้แล้ว...ครับขอบคุณมาก ๆทุกๆท่านมาก ๆเลยนะครับ..... ;D ;D :D ;) :)
-
ลองแล้วไม่ได้ครับ......ช่วยหน่อยครับ
Variable1 ====>
Value := GetSQLIntegerData('select count(*) from ovstdiag c left outer join vn_stat v on v.vn=c.vn where c.icd10="K081" and c.vstdate between "'+ds1+'" and "'+ds2+'" and v.sex="1"');
Variable2 ====>
Value := GetSQLIntegerData('select count(*) from ovstdiag c left outer join vn_stat v on v.vn=c.vn where c.icd10="K081" and c.vstdate between "'+ds1+'" and "'+ds2+'" and v.sex="2"');
Variable3
Value := Variable1.Value + Variable2.Value
ผลที่ได้
ชื่อโรค ชาย หญิง รวม
K018 3 14 314
คิดง่าย ๆ ก็เอาตัวเงื่อนไขเพศออกไปซะ (อย่าเอาเครื่องเพศออกก็แล้วกัน 555555555)
Variable3 ====>
Value := GetSQLIntegerData('select count(*) from ovstdiag c left outer join vn_stat v on v.vn=c.vn where c.icd10="K081" and c.vstdate between "'+ds1+'" and "'+ds2+'"');
-
สมกับเป็นตัวจริง ครับ อ.โก้
-
ลองแล้วไม่ได้ครับ......ช่วยหน่อยครับ
Variable1 ====>
Value := GetSQLIntegerData('select count(*) from ovstdiag c left outer join vn_stat v on v.vn=c.vn where c.icd10="K081" and c.vstdate between "'+ds1+'" and "'+ds2+'" and v.sex="1"');
Variable2 ====>
Value := GetSQLIntegerData('select count(*) from ovstdiag c left outer join vn_stat v on v.vn=c.vn where c.icd10="K081" and c.vstdate between "'+ds1+'" and "'+ds2+'" and v.sex="2"');
Variable3
Value := Variable1.Value + Variable2.Value
ผลที่ได้
ชื่อโรค ชาย หญิง รวม
K018 3 14 314
คิดง่าย ๆ ก็เอาตัวเงื่อนไขเพศออกไปซะ (อย่าเอาเครื่องเพศออกก็แล้วกัน 555555555)
Variable3 ====>
Value := GetSQLIntegerData('select count(*) from ovstdiag c left outer join vn_stat v on v.vn=c.vn where c.icd10="K081" and c.vstdate between "'+ds1+'" and "'+ds2+'"');
;D :D ;D :D5555
มาตอบไม่ทันเล้ย....