我编了一个数据库小程序,在DateTimePicker1中设置了format属性为yy-MM-dd ,显示日期如2011-07-06,为什么在SQL语句作比较的时候变成了2011-7-6,我要的结果是2011-07-06,如何实现语句如下:with gztj do
begin
close();
sql.text:='select * from ta where rq >'+''''+datetostr(DateTimePicker1.Date)+'''';
active:=true;
open
end;
begin
close();
sql.text:='select * from ta where rq >'+''''+datetostr(DateTimePicker1.Date)+'''';
active:=true;
open
end;
假如你設置成dd.mm.yyyy,那你得到的結果會是16.07.2011
还是用formatdatetime按自己要求的转安心