=query(IMPORTRANGE("URL","Audit Template!A1:AD994"), "SELECT a,b,c,g,p WHERE b = 'name’ AND p = 'yes'")
error:
Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "yes "" at line 1, column 55. Was expecting one of: "group" ... "pivot" ... "order" ... "skipping" ... "limit" ... "offset" ... "label" ... "format" ... "options" ... "and" ... "or" ...
it means that if you use indirect range such as IMPORTRANGE
then you need to use Col
references:
=QUERY(IMPORTRANGE("URL", "Audit Template!A1:AD"),
"select Col1,Col2,Col3,Col7,Col16
where Col2 = 'name'
and Col16 = 'yes'", 0)
=QUERY(IMPORTRANGE("1gUxnjlhZlTgpw0gf-wuBgbf0zqmiKmoZKLCbfxQ6p5E", "Audit Template!A1:AD"),
"select Col1,Col2,Col3,Col7,Col16
where Col1 contains 'name'
and Col16 = 'yes'", 1)