Rynez
Rynez

Reputation: 9

"No Column" error in google sheets when using query function

I am trying to query in order to ultimately, select between a date range to show only dates between YYYY-MM-DD and YYYY-MM-DD Current code i am trying to use:

=QUERY({"Master!A:J"}, "select * where Col1 >= date '2022-01-01' AND Col1 <= date '2022-01-31'")

I have also tried:

=QUERY({"Master!A:J"}, "select * where D >= date '2022-01-01' AND D <= date '2022-01-31'")

the data from the master sheet is being received by an apps script if that makes a difference?

test sheet: https://docs.google.com/spreadsheets/d/e/2PACX-1vTjTlorc1KKmMjgR3-N4agrLK3RFme2dmYwe7hF6fWotDtPbZJg71O1S0jJv0tIqwtIGTi_l61LSIE7/pubhtml

Upvotes: 1

Views: 1124

Answers (1)

player0
player0

Reputation: 1

try:

=QUERY({Master!A:J}, 
 "where Col1 >= date '2022-01-01' 
    and Col1 <= date '2022-01-31'")

or:

=QUERY({Master!A:J}, 
 "where month(Col1)+1 = 1 
    and year(Col1) = 2022")

Upvotes: 0

Related Questions