This question already has an answer here:

In the attribute table I can use this expression

left(   "CODE" ,1)='E' or left( "CODE" ,1)='W'

to select features successfully, but when I try to use the same expression in the Properties, General, Query Builder window, to display a subset of features on the map it gives an error:

SQL Expression Parsing Error: syntax error, unexpected LEFT

Is there an alternative syntax I can use in the Properties dialog to achieve the same?

marked as duplicate by Matthias Kuhn, John Powell, Evil Genius, Andre Silva, jbchurchill Nov 16 '16 at 16:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Found the answer - you use substr( "CODE" ,1,1)='E' and it works! – simonc8 Nov 16 '16 at 13:02

Browse other questions tagged or ask your own question.