Search code examples
sqlgoogle-sheetsformattinggoogle-sheets-formulagoogle-query-language

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


So I am trying to query data from Sheet2 to another using parameters from Sheet1 and the query works fine for the first parameter but the second parameter I get the error message

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

Here is my function

=QUERY(Sheet2!A1:D10,"SELECT C WHERE A = "& B1 &" AND B = " & D1, 0)

Here is my example sheet to see my issue

https://docs.google.com/spreadsheets/d/14nBFL-WPdwSu9PUMYShRZqCAfo20oBl-4ZCDrvjDHqk/edit?usp=sharing


Solution

  • use:

    =QUERY(Sheet2!A1:D10, "SELECT C WHERE A = "&B1&" AND B = '"&D1&"'", 0)
    

    enter image description here