使用或加入查询功能

发布于 2025-02-04 05:35:14 字数 917 浏览 3 评论 0原文

I currently have a QUERY function which is set up based on a start date cell and an end date cell, formula as below:

=QUERY(Haulage!$A$3:$L$29," Select * Where A >=日期“”& text('2022 Stats'!s1,“ yyyy-mm-dd”) -mm-dd")&"""")

This is working fine but I would like to adapt it so I can also narrow the query down further with the use of a dropdown. I have the following IF formula for this:

=IF('2022 Stats'!V1="All TOCs",""," AND LOWER(K) = LOWER('"&'2022 Stats'!V1& "') " )

This seems to yield the correct results but I am struggling to get the two to work together......

Link to sheet: https://docs.google.com/spreadsheets/d/1wTWuvFwMTqJ-sjIZbXWpGOS1WKwpODj2R8KAzqlqkuw/edit?usp=sharing

I currently have a QUERY function which is set up based on a start date cell and an end date cell, formula as below:

=QUERY(Haulage!$A$3:$L$29," Select * Where A >= date """&text('2022 Stats'!S1, "yyyy-mm-dd")&""" AND A <= date """&text('2022 Stats'!T1, "yyyy-mm-dd")&"""")

This is working fine but I would like to adapt it so I can also narrow the query down further with the use of a dropdown. I have the following IF formula for this:

=IF('2022 Stats'!V1="All TOCs",""," AND LOWER(K) = LOWER('"&'2022 Stats'!V1&"') " )

This seems to yield the correct results but I am struggling to get the two to work together......

Link to sheet: https://docs.google.com/spreadsheets/d/1wTWuvFwMTqJ-sjIZbXWpGOS1WKwpODj2R8KAzqlqkuw/edit?usp=sharing

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红焚 2025-02-11 05:35:14

尝试:

=QUERY(Haulage!A3:L29,
 "where A >= date '"&TEXT('2022 Stats'!S1, "yyyy-mm-dd")&"' 
    and A <= date '"&TEXT('2022 Stats'!T1, "yyyy-mm-dd")&"'"&
 IF('2022 Stats'!V1="All TOCs",,"
    and lower(K) = '"&LOWER('2022 Stats'!V1)&"'"))

Try:

=QUERY(Haulage!A3:L29,
 "where A >= date '"&TEXT('2022 Stats'!S1, "yyyy-mm-dd")&"' 
    and A <= date '"&TEXT('2022 Stats'!T1, "yyyy-mm-dd")&"'"&
 IF('2022 Stats'!V1="All TOCs",,"
    and lower(K) = '"&LOWER('2022 Stats'!V1)&"'"))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文