X
xcdx
Unregistered / Unconfirmed
GUEST, unregistred user!
var
s:string;
begin
s:=edit1.Text;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select TD001,TD002, TD005,TD004,TD006,TD008,TD015,(TD008-TD015)as 未交數量,TD010,TD011,TD012,TC009,TC004,TC003,TC002,MA001,MA002 from PURTD,PURTC,PURMA');
adoquery1.SQL.Add('where TC004=MA001');
adoquery1.SQL.Add('and MA001='+#39+S+#39);
adoquery1.SQL.Add('and TC002=TD002');
adoquery1.SQL.Add('and (TD008-TD015)>0');
adoquery1.SQL.Add('OR TD001='''+ComboBox1.Text+'''');
adoquery1.SQL.Add('OR TC003='''+trim(edit3.Text)+'''');
adoquery1.SQL.Add('OR TD002='''+trim(edit4.Text)+'''');
ADOQUERY1.ExecSQL;
adoquery1.Open;
edit2.Text:=adoquery1.fieldbyname('MA002').AsString;
查詢時無法顯示數據
s:string;
begin
s:=edit1.Text;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select TD001,TD002, TD005,TD004,TD006,TD008,TD015,(TD008-TD015)as 未交數量,TD010,TD011,TD012,TC009,TC004,TC003,TC002,MA001,MA002 from PURTD,PURTC,PURMA');
adoquery1.SQL.Add('where TC004=MA001');
adoquery1.SQL.Add('and MA001='+#39+S+#39);
adoquery1.SQL.Add('and TC002=TD002');
adoquery1.SQL.Add('and (TD008-TD015)>0');
adoquery1.SQL.Add('OR TD001='''+ComboBox1.Text+'''');
adoquery1.SQL.Add('OR TC003='''+trim(edit3.Text)+'''');
adoquery1.SQL.Add('OR TD002='''+trim(edit4.Text)+'''');
ADOQUERY1.ExecSQL;
adoquery1.Open;
edit2.Text:=adoquery1.fieldbyname('MA002').AsString;
查詢時無法顯示數據