แนว ๆ นี้ครับ.. ลองเข้าไปตรวจสอบและจับคู่ตามรหัสสิทธิของเราในตาราง pttype ครับ
pc1 := getsqlsubquerydata('select pttype from pttype where pcode in ("A2")');
pc2 := getsqlsubquerydata('select pttype from pttype where pcode in ("A7")');
pc3 :=
getsqlsubquerydata('select pttype from pttype where pcode in ("UC","UA")');
pc4 :=
getsqlsubquerydata('select pttype from pttype where pcode in ("AA","AB","AC","AD","AE","AF","AG","AH","AI","AJ","AK","UB")');
pc5 := getsqlsubquerydata('select pttype from pttype where pcode in ("AL")');
pc6 := getsqlsubquerydata('select pttype from pttype where pcode in ("AM")');
pc7 := getsqlsubquerydata('select pttype from pttype where pcode not in (' +
'"A2","A7","UC","UA","UB","AA","AB","AC","AD","AE","AF","AG","AH","AI","AJ","AK",' +
'"AL","AM" ) ');
pc7:=pc7+','+getsqlsubquerydata('select pttype from pttype where pcode IS NULL');
ตรวจสอบสิ่งที่ค้นหาใน TAB Calc หมวด Event ครับ..