Query3.Close;
Query3.SQL.Clear; Query3.SQL.Add('Select Count(*) From oa_fw_data t where to_char(SCRQ,'+'''+'yyyy-MM-dd'+'''+')=:a');
Query3.ParamByName('a').Value:=DateToStr(Date());
Query3.Open;
Query3.SQL.Add('Select Count(*) From oa_fw_data t where to_char(SCRQ,'+'''+'yyyy-MM-dd'+'''+')=:a');这一句
Query3.SQL.Clear; Query3.SQL.Add('Select Count(*) From oa_fw_data t where to_char(SCRQ,'+'''+'yyyy-MM-dd'+'''+')=:a');
Query3.ParamByName('a').Value:=DateToStr(Date());
Query3.Open;
Query3.SQL.Add('Select Count(*) From oa_fw_data t where to_char(SCRQ,'+'''+'yyyy-MM-dd'+'''+')=:a');这一句
?
看看sql.text
mssql如果是想看当天的记录数这样
with adoquery1 do
begin
close;
sql.text := 'Select Count(*) From oa_fw_data t where SCRQ=:rq';
parameters[0].value := FormatDatetime('yyyy-mm-dd',date());
open;
showmessage(inttostr(Fields[0].asInteger));
end;