Sheetsee - 使用sheetsee在sql语句中插入变量

时间:2015-01-29 12:44:39

标签: jquery google-sheets

出于某种原因,我无法获得下面提到的查询以使用sheetsee和google电子表格。这很可能是我....但我真的需要有人来帮助我吗?

非常感谢提前! 罗伯特


// spreadsheet URL.
var PARTICIPANTS = KEY

// Load Sessions per client
var client = 'C005';

$('#sessions-clients').sheetrock({
    url: PARTICIPANTS,
    sql: "select N where B = " + $client +"",
    headers: 1,
    headersOff: false,
    formatting: true,
    labels: ['Projects']
});

1 个答案:

答案 0 :(得分:0)

添加答案,这对其他人有用:

我在网络上找到了example,其字符串如下:

sql: "select %Name%," + columnLabel + " where " + columnLabel + " contains 'X'"

所以我的猜测是它必须

"select N where B = '"+ $client + "'"

但实际上user2523051发现正确答案是:

"select E where B = '"+ client + "'" //<- without the "$"