3

I'm using google sheets, and I found that this doesn't work:

=QUERY(CSV!1:1000,"select J, AA, AD where J<date'2004-01-01'")

But this does:

=QUERY(CSV!1:1000,"select J, AA, AD where J>date'1900-01-01' and not J>date'2004-01-01'")

Can someone please explain why I have to make my query more complicated to filter by date?

player0
  • 124,011
  • 12
  • 67
  • 124

1 Answers1

2

try:

=QUERY(CSV!1:1000, "select J,AA,AD where J < date'2004-01-01' and J is not null", )
player0
  • 124,011
  • 12
  • 67
  • 124
  • 1
    That worked...but why? I had 4 non-null results but none get returned unless the null check exists? – user5061526 Sep 15 '22 at 18:54
  • @user5061526 most likely they were returned but at the bottom of the sheet coz null rows came first/on top – player0 Sep 15 '22 at 18:57