Home > database >  GSheet: Query rows within date range in different columns
GSheet: Query rows within date range in different columns

Time:06-01

I have a data source

So far I've come up with this query but it does not return the correct name. What it actually does is just return the first 2 names without any regard to the where clause conditions.

=QUERY(A2:C;"SELECT A WHERE B >= "&TODAY()&" AND C <= "&TODAY() 6&" LIMIT 0";2)

result with just first 2 rows

I can't figure out what could be the problem here.

CodePudding user response:

try:

=QUERY(A2:C; 
 "select A 
  where B >= date '"&TEXT(TODAY();   "e-m-d")&"' 
    and C <= date '"&TEXT(TODAY() 6; "e-m-d")&"'"; 0)
  • Related