當前位置:編程學習大全網 - 電腦編程 - delphi組合查詢

delphi組合查詢

sql:string;

sql:='select * from table where ';

if edit5.text<>'' then

sql=sql+' 藥品名稱='+''''+edit5.text+''''+' and ';

if edit2.text<>'' then

sql=sql+' 進貨廠家='+''''+edit2.text+''''+' and ';

if (edit3.text<>'')and (edit6.text<>'') then

sql=sql+' 銷售單價 between '+''''+ edit3.text +''''+' and'+''''+ edit6.text +''''+ ' and ';

if (edit4.text<>'')and (edit7.text<>'') then

sql=sql+' 進貨單價 between '+''''+ edit4.text +''''+' and'+''''+ edit7.text +'''';

query.sql.clear;

query.sql.add(sql);

query.open;

  • 上一篇:cad中我想輸入4個點的坐標形成壹個矩形,怎麽畫出來就是壹個對的坐標啊,而且顯示的是直線
  • 下一篇:學軟件測試之前,必須要學好java編程、web、網絡技術、數據庫等壹些知識嗎?
  • copyright 2024編程學習大全網