Search code examples
google-sheetsgoogle-sheets-formula

How to set date criteria from a cell in a QUERY() formula in Google Sheets?


How can I use a google sheet cell as reference instead of todate(now))?

=QUERY('Task Data'!A:M,"select C, D, E, F, H, B, L, M where D < todate(now()) and G matches false")

Solution

  • You may try:

    =QUERY('Task Data'!A:M,"select C, D, E, F, H, B, L, M where D < date '"&text(N1,"yyyy-mm-dd")&"' and G matches false")
    

    enter image description here