14

The following line doesn't work:

=QUERY(AB:AE,"select AB,AC,AD,AE where AB NOT LIKE '%Info%'",1)

Throws:

Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "AH "" at line 1, column 26. Was expecting one of: "(" ... "("

However, this one does:

=QUERY(AB:AE,"select AB,AC,AD,AE where AB LIKE '%Info%'",1)
TheMaster
  • 45,448
  • 6
  • 62
  • 85
IdoS
  • 482
  • 1
  • 10
  • 18
  • 2
    What does "not work" mean? I suspect that it merely doesn't do what you expect, because you don't fully understand how it works. – Gordon Linoff May 11 '19 at 18:49
  • Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "AH "" at line 1, column 26. Was expecting one of: "(" ... "(" ... – IdoS May 12 '19 at 19:43

2 Answers2

25

NOT should be before column identifier:

=QUERY(AB:AE,"select AB,AC,AD,AE where NOT AB LIKE '%Info%'",1)
TheMaster
  • 45,448
  • 6
  • 62
  • 85
3

Probably column AB is nullable:

=QUERY(AB:AE,"select AB,AC,AD,AE where AB NOT LIKE '%Info%' OR AB IS NULL",1)

The Three-Valued Logic of SQL

AB + (NOT AB) + (NULL in column AB) <=> entire set
Lukasz Szozda
  • 162,964
  • 23
  • 234
  • 275
  • Tried this:=QUERY(AH:AK,"select AH,AI,AJ,AK where AH NOT LIKE '%Info%' OR AH IS NULL",1) and still getting this error: Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "AH "" at line 1, column 26. Was expecting one of: "(" ... "(" ... – IdoS May 12 '19 at 19:51