哪位高手帮我看看,总是提示字符串转换为datetime发生语法错误
string str1,errors
datetime olddate,newdate
olddate=datetime(date(em_2.text),23:59:59)
newdate=datetime(date(em_3.text),23:59:59)
str1="select (cp.cpmc) as 菜品名称, (cp.dw) as 单位, sum(pjnr.sl)as 赠品数量 , (cp.jg) as 品项实际价格,sum(pjnr.sl)*cp.jg as 赠品总价 from cp,pjnr,yypj where (yypj.fwls=pjnr.fwls) and (pjnr.jg=0) and (yypj.fwfs='送菜') and (cp.cpzj=pjnr.cpzj) and yypj.rqsj<='newdate' group by pjnr.cpzj,cp.cpmc,cp.dw,cp.jg"
dw_2.create(sqlca.syntaxfromsql(str1,"style(type=grid)",errors))
dw_2.settrans(sqlca)
dw_2.retrieve()
[解决办法]