J
jedilee
Unregistered / Unconfirmed
GUEST, unregistred user!
我想利用变量来查询库,date 如果是日期形式如 011211 该定义为何种类型,sql语句该如何写?得到的值赋给value ,可如下执行后,value为0,sql中引号和加号的使用如何实现?请指教!
var
Date:string;
begin
date:=Edit1.Text;
with Query1 do
begin
close;
SQL.Clear;
SQL.Add('select count(*) from fsdxx where rq='''+date+'''' );
Open;
value:=Fields[0].AsInteger;
End;
var
Date:string;
begin
date:=Edit1.Text;
with Query1 do
begin
close;
SQL.Clear;
SQL.Add('select count(*) from fsdxx where rq='''+date+'''' );
Open;
value:=Fields[0].AsInteger;
End;