不是delphi的处理,数据库那边该怎样就是怎样,比如access库 query1.sql.text:='select * from employee where In_date=#''2003-03-21 17:00:00''#'
Query1.SQL.Clear; Query1.SQL.Add('select * from employee where In_date = :dt'); Query1.ParamByName('dt').AsDateTime := StrToDate('2003-1-1'); Query1.Open;
看你用什么数据库 ms sql就用上面那位大哥的东西 oracle中 select * from employee where In_date=to_date('yyyy-mm-dd','xxx')
sql server Query1.SQL.Add('select * from ddd where 违章时间>'''+datetostr(date())+'''') access Query1.SQL.Add('select * from ddd where 违章时间>'#+datetostr(date())+'#')
query1.sql.text:='select * from employee where In_date=#''2003-03-21 17:00:00''#'
Query1.SQL.Add('select * from employee where In_date = :dt');
Query1.ParamByName('dt').AsDateTime := StrToDate('2003-1-1');
Query1.Open;
ms sql就用上面那位大哥的东西
oracle中
select * from employee where In_date=to_date('yyyy-mm-dd','xxx')
Query1.SQL.Add('select * from ddd where 违章时间>'''+datetostr(date())+'''')
access
Query1.SQL.Add('select * from ddd where 违章时间>'#+datetostr(date())+'#')