2016-04-01 40 views
1

從谷歌圖表查詢過濾器中觀察到一些奇怪的行爲。谷歌圖表查詢語言不過濾日期範圍數據

查詢:

sqlQuery = "sql?tq=select * where execution_date >= '" + startDate + "' and execution_date <= '" + endDate + "' &sqlQueryID=daily_runs" 

這僅適用於1個月,它沒有過濾掉的時間範圍。

當我從3月1日到3月30日的數據 - 它被過濾和顯示。

查詢:

"sql?tq=select * where where Date >= 'Mar 25, 2016' and Date <= 'Mar 31, 2016' &sqlQueryID=daily_runs" 

結果:> 0行

當我有從3月1日至四月一日的日期 - 它沒有被過濾和返回0行。

查詢:

"sql?tq=select * where where Date >= 'Mar 25, 2016' and Date <= 'Apr 01, 2016' &sqlQueryID=daily_runs" 

結果:0行

回答

0

嘗試使用日期格式在SELECT語句中Where Clause Examples
where date '2005-01-21' < hireDate

提到,格式startDateendDateYYYY-MM-DD和前綴爲date

select * where execution_date >= date '" + startDate + "' ...

+0

感謝它的工作,我以前綴和工作。 – IamRKY