想用谷歌表单中的查询功能按日期统计订单数量



我正在尝试使用查询功能和排序来计算今天的订单总数。

我可以通过这个按状态计数。

=QUERY('2021'!A1:AA5000, "select G,
count(V) where V is not null and V ='In Process'
group by G
order by count(V) desc
label count(V) 'New Order'")

但不知道如何按日期计数我有日期格式为yyyy-mm-dd的C列。我想显示一下昨天的订单总数。我试过这个

=QUERY('2021'!A1:AA5000, "select G,
count(C) where C is not null and C =TODAY()-1
group by G
order by count(C) desc
label count(C) 'yesterday Orders'")

它抛出一个#值或#错误

请帮助

尝试

=QUERY('2021'!A1:G, "select G, count(C) where C = date '"&TEXT(TODAY()-1, "yyyy-mm-dd")&"' group by G order by count(C) desc label count(C) 'yesterday Orders'", 1)

看看这是否有效?

参考

  • 在QUERY中使用日期标准

最新更新