with Query1 do begin Close; Sql.Clear; Sql.Add('select * from xxxx.db where birthday =:birthday'); ParamByName('birthday').AsDateTime := StrToDate('82/2/2'); Open; end;
在sql explorer中查询那怎么办呢???不能用参数不清吧?
select * form XXX.db where birthday='82-12-12'//你的标点符号错了 如果改了也不行,试一下 select * form XXX.db where birthday=‘1982-12-12’ 还有,你的sql用在什么数据库上,如果是access,要加‘#’
你sql里birthday字段定义的是什么格式的呀,是datetime吗 如果是: in_date:=strtodate('82-12-12'); query.sql.add('select * form XXX.db where birthday like :da'); query.Parameters.ParamByName('da').Value:=in_date; 你试试!
begin
Close;
Sql.Clear;
Sql.Add('select * from xxxx.db where birthday =:birthday');
ParamByName('birthday').AsDateTime := StrToDate('82/2/2');
Open;
end;
如果改了也不行,试一下
select * form XXX.db where birthday=‘1982-12-12’
还有,你的sql用在什么数据库上,如果是access,要加‘#’
如果是:
in_date:=strtodate('82-12-12');
query.sql.add('select * form XXX.db where birthday like :da');
query.Parameters.ParamByName('da').Value:=in_date;
你试试!
看看bde,configuration/system/formats/date/separator