查询语句如下:
var
str,sj1,sj2:string;
sj1:=datetostr(datetimepicker1.date)+' '+timetostr(datetimepicker3.Time);
sj2:=datetostr(datetimepicker2.date)+' '+timetostr(datetimepicker4.Time);
str:=str+'select * from zlb_lgz_hxcf where rq between '''+sj1+''' and '''+sj2+'''';
运行出现错误:project lgz.exe raised exception class EOleException with message'从字符串转换为datetime时发生语法错误。'.process stopped.use step or run to continue.
求助:为什么?
之前这个程序我明明已经调试好了的啊,放了1个月再拿出来怎么就出错误了呢?
var
str,sj1,sj2:string;
sj1:=datetostr(datetimepicker1.date)+' '+timetostr(datetimepicker3.Time);
sj2:=datetostr(datetimepicker2.date)+' '+timetostr(datetimepicker4.Time);
str:=str+'select * from zlb_lgz_hxcf where rq between '''+sj1+''' and '''+sj2+'''';
运行出现错误:project lgz.exe raised exception class EOleException with message'从字符串转换为datetime时发生语法错误。'.process stopped.use step or run to continue.
求助:为什么?
之前这个程序我明明已经调试好了的啊,放了1个月再拿出来怎么就出错误了呢?
var
str,sj1,sj2:string;
begin
sj1:=datetostr(datetimepicker1.date)+' '+timetostr(datetimepicker3.Time);
sj2:=datetostr(datetimepicker2.date)+' '+timetostr(datetimepicker4.Time);
str:=str+'select * from zlb_lgz_hxcf where rq between '''+sj1+''' and '''+sj2+'''';
memo1.lines.text := str;
end;
控制面板---区域和语言选项,都改为yyyy-MM-dd和HH:mm:ss就行了。