str1 := 'select khmch,hyh,hh,bh,mxbh,gpjsrq,cf,sum(isnull(wtr,0)) as trzl ';
str1 :=str1+' from htyrerp01' + curgsbh +'..JHB_ztrjhysmx ';
str1 :=str1+' where (gsbh=''' + curgsbh + ''')';
if trim(Edit1.Text)<>'' then
str1:=str1+' and (gpjsrq>='''+Edit1.Text+''') ';
if trim(Edit2.Text)<>'' then
str1:=str1+' and (gpjsrq<='''+Edit2.Text+''') ';
if trim(Edit3.Text)<>'' then
str1:=str1+' and (rsjsrq>='''+Edit3.Text+''') ';
if trim(Edit4.Text)<>'' then
str1:=str1+' and (rsjsrq<='''+Edit4.Text+''') ';
if trim(Edit5.Text)<>'' then
str1:=str1+' and (a.khmch='''+Edit5.Text+''') ';
str1 := str1 + ' group by khmch,hyh,hh,bh,mxbh,gpjsrq,cf ';
query1.Close;
query1.CommandText := str1;
query1.Open;
query1.first;
除錯到 query1.Open;卡住了,沒有任何報錯,程式死掉了,這是為什么,急求
uj5u.com熱心網友回復:
沒報錯應該是沒查詢完。這SQL陳述句看起來比較耗時,輸出SQL陳述句,在查詢分析器里執行一下,看看有無錯誤,需要多長時間能出結果。轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/55081.html
標籤:語言基礎/算法/系統設計
