在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1.parameter不需要# procedure TForm1.Button2Click(Sender: TObject); begin with adoquery1 do begin Close; sql.clear; sql.add('select * from ddd where end_date<=:e_date'); Parameters.ParamByName('e_date').Value:=FormatDateTime('yyyy-mm-dd hh:mm:ss',now()); open; end; end; 2.formatedatetime需要# procedure TForm1.Button3Click(Sender: TObject); begin with adoquery1 do begin Close; sql.clear; sql.add('select * from ddd where end_date<= '+'#'+FormatDateTime('yyyy-mm-dd',now())+'#'); open; end; end; 3.直接参数# procedure TForm1.Button4Click(Sender: TObject); begin with adoquery1 do begin Close; sql.clear; sql.add('SELECT * FROM ddd where end_date <= #2004-9-14#'); open; end; end; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论