在SQL中使用正常的查询语句,在Access数据库中使用报错。字段内容都一样。
在SQL中使用正常的查询语句,在Access数据库中使用报错。字段内容都一样。请大侠帮我看看要改哪些地方?
//===========================SQL2000版======================================= with dtm.QryExec do begin Close; SQL.Clear; SQL.add('insert into LiuShui(pzh,sfbz,UserName,YsMoney,ll,KxDate) '); SQL.add('select a.Pzh,''收'',a.h_UName,a.h_Money,b.ll,convert(varchar(100),a.h_date,23)) from hdinfo a join dkinfo b on (a.h_kxPzh=b.pzh) where a.Lrdate between :TimeBegin and :TimeEnd'); Parameters.ParamByName('TimeBegin').Value:=DateToStr(DateTime1.Date); Parameters.ParamByName('TimeEnd').Value:=DateToStr(DateTime2.Date+1); execsql; end;//===========================Access版======================================= with dtm.QryExec do begin Close; SQL.Clear; SQL.add('insert into LiuShui(pzh,sfbz,UserName,YsMoney,ll,KxDate) '); SQL.add('select a.Pzh,''收'',a.h_UName,a.h_Money,b.ll,str(a.h_date) from hdinfo a join dkinfo b on (a.h_kxPzh=b.pzh) where a.Lrdate between :TimeBegin and :TimeEnd'); Parameters.ParamByName('TimeBegin').Value:=DateToStr(DateTime1.Date); Parameters.ParamByName('TimeEnd').Value:=DateToStr(DateTime2.Date+1); execsql; end;