如何对“本周”的日期进行Google工作表查询

时间:2017-09-22 23:18:25

标签: date google-sheets

我正在尝试根据“确认的拍摄”标签中的一个“日期”列,在一个谷歌工作表标签中放入一个查询,该标签从另一个标签(称为确认拍摄)中提取数据。我想从本周开始抽取任何东西,可能取自周数(WEEKNUM)。

我有一个类似的公式在另一个标签中工作,我将在明天安排的所有内容,即:

=query('Confirmed Shoots'!A1:Y,"Select G,J,I,H,C,E,F,K,L,N,D Where G=date"""&text(TODAY()+1,"yyyy-mm-dd")&""" ")

我还找到了一种方法,可以从这个IF公式的日期拉出“本周” -

=IF(WEEKNUM(G2)=WEEKNUM(NOW()),"Yes","")

我正在努力学习语法,试图将两者结合起来。我希望它像:

=query('Confirmed Shoots'!A1:Y,"Select G,J,I,H,C,E,F,K,L,N,D Where (WEEKNUM(G2)=WEEKNUM(NOW()),"yyyy-mm-dd")&""" ")")

=query('Confirmed Shoots'!A1:Y,"Select G,J,I,H,C,E,F,K,L,N,D Where (WEEKNUM(G2)=WEEKNUM(NOW())

这两个都给了我错误。有谁知道如何做到这一点?谢谢!

1 个答案:

答案 0 :(得分:0)

尝试:

=FILTER(QUERY('Confirmed Shoots'!A1:Y,"Select G,J,I,H,C,E,F,K,L,N,D"), WEEKNUM('Confirmed Shoots'!G1:G)=WEEKNUM(NOW()))