Query builder

2266
6
Jump to solution
10-14-2014 12:42 AM
MassimoSpirlandelli
New Contributor II

In my "level curves" (1 meter definition) shp file  I want to query:

- the pair numbers (for instance: 102, 104, 106, 108, 110 , ect. ect.)

- every five meters (for instance: 100, 105, 110, 115, 120, 125, ect. ect.)

 

How can I do quickly instead of select every single record?

Is there any query?

 

thank you

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Esteemed Contributor

if you have to do this with a lot of records, consider building a temporary field then you can query that field for the appropriate ranges  see the example of using the mod (%) function in python.  Unfortunately the query builder doesn't support native python at present.

ModulousExample.png

View solution in original post

6 Replies
JohannesBierer
Regular Contributor

With python:

for i in range(102, "End", 2:(
  
print i

0 Kudos
MassimoSpirlandelli
New Contributor II

could you explain me clearly with details (I have never used directly python) ?

0 Kudos
JohannesBierer
Regular Contributor

The best is to create a model with select by attribute - then export the model to python and modificate the python code with the for i in range command?

0 Kudos
MassimoSpirlandelli
New Contributor II

ok but with query builder it isn't possible ?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

if you have to do this with a lot of records, consider building a temporary field then you can query that field for the appropriate ranges  see the example of using the mod (%) function in python.  Unfortunately the query builder doesn't support native python at present.

ModulousExample.png

MassimoSpirlandelli
New Contributor II

THANK YOU !

easy and fast !!

0 Kudos