脚本语言如下:
ls_where = " and convert(varchar(10),ht_rm_cashier.starttime,23) >= '" + string(ld_begin,"YYYY-MM-DD")+ "' and convert(varchar(10),ht_rm_cashier.starttime,23) <= '"+ string(ld_end,"YYYY-MM-DD") +"'"
ls_temp = Upper(dw_1.getsqlselect())
ll_pos = pos(ls_temp,"GROUP BY")
ls_syntax = left(ls_temp,(ll_pos -1))//select * from
ls_groupby = right(ls_temp,(len(ls_temp) - ll_pos +1))//group by
ls_temp = ""
ls_temp = ls_syntax +"~r~n" + ls_where +"~r~n" + ls_groupby
dw_1.setsqlselect(ls_temp)
dw_1.retrieve()
dw_1.setsqlselect(ls_temp) 返回值为 1
dw_1.retrieve() 返回值为 0
------解决方案--------------------
dw_1有没有设置dataobject?
------解决方案--------------------
你的意思拼接后的ls_temp,sql语句在查询分析器中可以查到数据?在DW.retrieve()没数据?
你试试dw先不SetSqlselect能retireve到数据不能?