首页 > 解决方案 > 谷歌表格 - 查询导入范围选择今天的日期

问题描述

我有一个要向其中导入数据的工作表。源工作表的第 4 列包含日期。我只想导入来自 today() 日期的行。

我的出发点是:

={unique(QUERY(IMPORTRANGE("URL","Sheet1!A3:L1000"), "select Col9,Col1,Col4,Col3,Col5 where Col1 is not null order by Col4"));}

标签: google-sheets

解决方案


尝试调整 where 子句:

where Col1 is not null and Col4 = date '"&text(today(),"yyyy-mm-dd")&"'

所以查询变为:

={unique(QUERY(IMPORTRANGE("URL","Sheet1!A3:L1000"), "select Col9,Col1,Col4,Col3,Col5 where Col1 is not null and Col4 = date '"&text(today(),"yyyy-mm-dd")&"' "));}

推荐阅读