I'm trying to make a style based on rules, and I want to use a boolean field I have created for that.

But I do the following:

"field" like 'TRUE'
"field" like TRUE
"field" like 1
"field" like '1'

and nothing is selected.

How can I select true values in a boolean field then? I'm using QGIS reading from PostGIS database.

  • 1
    Would you be able to edit your question to include the GIS software that you are using, please ? – PolyGeo May 25 '15 at 20:11
  • 2
    I don't think the boolean field supports the like operator, try "field" = 1 instead. – Michael Stimson May 25 '15 at 21:18
  • What data source are you using? QGIS doesn't even support creating bool fields in new Shapefiles or Spatialite afaik. – underdark May 25 '15 at 21:54
  • Sorry: I'm using a postGIS database – user3733164 May 25 '15 at 22:06

Finnally I have found the solution:

"field" like 't'

Thank you


I would recommend, in order to see how QGIS views the values, to use the "all unique" button.

You should get a list of values.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.