Search code examples
arrayssortinggoogle-sheetsgoogle-sheets-formulagoogle-query-language

Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: A


I'm trying to get a random meal planner set up and am stuck on getting this error message, "Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: A" on this piece of code

=QUERY({Curries!A2:D;Soups!A2:D;Pasta!A2:D;Casseroles!A2:D},"Select A,C where C <= "& C4 &" Order by D desc Limit 5")

Any advice would be appreciated.


Solution

  • use Col references:

    =QUERY({Curries!A2:D; Soups!A2:D; Pasta!A2:D; Casseroles!A2:D},
     "select Col1,Col3 where Col3 <= "&C4&" order by Col4 desc limit 5")