Parse error from using .setValue or .SetFormula to set a formula containing a query function that has multiple single and double quotes

半腔热情 提交于 2019-11-29 18:07:30

Too easy! instead of '+ just use \ to escape the single quotes in my formula so answer is: range.setFormula('=QUERY(Data!A1:G,"select G, sum(E) where F is not null AND toDate(D)>= date \'" & text(\'Settings\'!B5, "yyyy-MM-dd")&"\' and toDate(D)<= date \'" & text(\'Settings\'!B6, "yyyy-MM-dd")&"\'group by G pivot B label G\'Pivot table for data in range\'")\');

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!