BMS-HOSxP Community
HOSxP => แจ้งปัญหา / ขอความช่วยเหลือ => ข้อความที่เริ่มโดย: yord ที่ พฤษภาคม 29, 2014, 10:10:49 AM
-
???ผมใส่คำสั่งนี้ ใน Variable และผมอยากได้คำตอบว่า
a:= GetSQLIntegerData('select sum(d.tcount)*3 as t from dtmain d '+
' where d.vstdate between "'+ds1+'" and "'+ds2+'" and '+
' d.doctor in ('+i+') and d.doctor in ('+doctor+') and '+
' d.tmcode in ("000136") and '+
' (d.ttcode like "%UPPER%" or d.ttcode like "%LOWWER%") ');
b:= GetSQLIntegerData('select sum(d.tcount) as t from dtmain d '+
' where d.vstdate between "'+ds1+'" and "'+ds2+'" and '+
' d.doctor in ('+i+') and d.doctor in ('+doctor+') and '+
' d.tmcode in ("000136") ');
ถ้า a มีคำตอบ ก็ให้แสดงคำตอบของ a
ถ้า a ไม่มีคำตอบ ก็ให้แสดงคำตอบของ b ครับ
ขอบคุณครับ
-
if a=0 then a:=b;
-
เขียนแบบนี้ไหมครับ
a:= GetSQLIntegerData('select sum(d.tcount)*3 as t from dtmain d '+
' where d.vstdate between "'+ds1+'" and "'+ds2+'" and '+
' d.doctor in ('+i+') and d.doctor in ('+doctor+') and '+
' d.tmcode in ("000136") and '+
' (d.ttcode like "%UPPER%" or d.ttcode like "%LOWWER%") ');
b:= GetSQLIntegerData('select sum(d.tcount) as t from dtmain d '+
' where d.vstdate between "'+ds1+'" and "'+ds2+'" and '+
' d.doctor in ('+i+') and d.doctor in ('+doctor+') and '+
' d.tmcode in ("000136") ');
if a=0 then a:=b;
error Incompatible types ครับ ???
-
ลองตรวจสอบ a,b ได้เป็น integer มั๊ย
สงสัยได้เป็น null
*****
ตรวจสอบดูนะคับ
*****
email/FB:woravet12@hotmail.com