0

I'm fairly new to ArcGIS and I'm trying to string along several queries. individually they work in same query they don't. background

I want to query all permit types rc, re, re/ap, and db; less than 30 days old, and only in certain counties.

I'll be making 3 layers with ranging dates <30, 30-60, 60-90, >90

whats working Layer 1:

"PERMITTYPE" ='RC' OR "PERMITTYPE" = 'RE' OR "PERMITTYPE" = 'RE/AP' OR "PERMITTYPE" = 'DB' AND "DATEFILED" >= CURRENT_DATE - 30

** This returns about 60 results in the below counties

Layer 2:

"COUNTY" IN ( 'BORDEN (TX)', 'GARZA (TX)', 'LYNN (TX)', 'KENT (TX)', 'SCURRY (TX)' )

Layer 3 (looking for different permit type but works)

"PERMITTYPE" = 'OD' AND DATEFILED >= CURRENT_DATE - 30 AND "COUNTY" IN ( 'BORDEN (TX)', 'GARZA (TX)', 'LYNN (TX)', 'KENT (TX)', 'SCURRY (TX)' )

New layer (not working )

"PERMITTYPE" ='RC' OR "PERMITTYPE" = 'RE' OR "PERMITTYPE" = 'RE/AP' OR "PERMITTYPE" = 'DB' AND "DATEFILED" >= CURRENT_DATE - 30 AND "COUNTY" IN ( 'BORDEN (TX)', 'GARZA (TX)', 'LYNN (TX)', 'KENT (TX)', 'SCURRY (TX)' )
2
  • ** layer 1 returns over 500 results all over tx but only 60 in the counties I'm interested in.
    – user28256
    Mar 19, 2014 at 19:40
  • Welcome to GIS Stack Exchange. Just a note, but if the answer below worked for you and solved the problem, you may want to mark it as the accepted answer (you should be be able to click a check mark on the left side of the answer to accept it). Doing this will remove it from the list of unanswered questions so people can more easily find questions that still need our help answering them.
    – John
    Mar 20, 2014 at 15:42

1 Answer 1

1

I would put the list of permittype between brackets otherwise the "and" only combines with permittype = DB.

( "PERMITTYPE" ='RC' OR "PERMITTYPE" = 'RE' OR "PERMITTYPE" = 'RE/AP' OR "PERMITTYPE" = 'DB' ) AND "DATEFILED" >= CURRENT_DATE - 30 AND "COUNTY" IN ( 'BORDEN (TX)', 'GARZA (TX)', 'LYNN (TX)', 'KENT (TX)', 'SCURRY (TX)' )
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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