rq3=DTOC(rq1,1) &&日期转字符,格式20090101 rq4=DTOC(rq2,1) &&日期转字符 ss1=sqlexec(nhandle,"select * from history where CONVERT(varchar(12),xdate,112)>=?rq3 and CONVERT(varchar(12),xdate,112)<=?rq4 and LEFT(xcode,4)=5301 ","history")
?rq3 ?rq4前删除?,语名无反应.虽然我能从服务器取数了,但想知道原因. 多谢各位老师指教
[解决办法] 在VFP中,传入变量前面要加?
or
ss1=sqlexec(nhandle,"select * from history where CONVERT(varchar(12),xdate,112)>="+rq3+" and CONVERT(varchar(12),xdate,112) <="+rq4+"and LEFT(xcode,4)='5301' ","history") [解决办法]
[解决办法] ss1=sqlexec(nhandle,"select * from history where CONVERT(varchar(12),xdate,112)>='" + rq3+ "' and CONVERT(varchar(12),xdate,112) <='" + rq4+ "' and LEFT(xcode,4)=5301 ","history") [解决办法] ss1=sqlexec(nhandle,"select * from history where CONVERT(varchar(12),xdate,112)>='"+rq3+"' and CONVERT(varchar(12),xdate,112) <='"+rq4+"' and LEFT(xcode,4)='5301' ","history")