I am trying to select house numbers that are between 200 and 499. I've been using:

"HOUSE_" >= '200' AND "HOUSE_" <= '499'

... and it's coming up with almost everything else. The numbers it does grab don't make sense at all either. I tried using a BETWEEN operator but that just gives me an error.

  • 5
    What software are you using? What database are you using? What is the datatype of the field: 'HOUSE_' ? Aug 4 '14 at 16:02
  • 2
    Try to put yourself in the position of the reader, your question is incomprehensible.
    – Leasye
    Aug 4 '14 at 16:06

The number values in your example query have quotation marks around them, so it looks like the problem is that your house numbers are stored as strings and not as numbers. You can check by right-clicking the field heading and clicking Properties.

If the type is String, you'll need to create a new House Number field of the Integer type. Use the Field Calculator to populate it with the values from the existing HOUSE_ field, then try your query again on the new integer House Number field. It should work the way you expect then.

  • 3
    Or if the field is already a number field, just remove the quotation marks around the numbers ("HOUSE_" >= 200 AND "HOUSE_" <= 499 Aug 4 '14 at 18:01

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