1

I'm using ArcMap 10.3. I'm trying to select by attributes different values from two columns.

I want to define the areas where

  1. Main rock is GRAVEL And
  2. Sub-rocks are :

a. mudstone tephra loess

b- sand mud

c- ...

d- ...

e- sand mud peat

I have tried to do it as shown below

"MAIN_ROCK" = 'gravel'  AND "SUB_ROCKS" = 'sandstone siltstone mudstone limestone silt lignite' AND "SUB_ROCKS" = 'mudstone tephra loess'  AND "SUB_ROCKS"= 'sandstone mudstone tephra silt lignite' AND "SUB_ROCKS" = 'sand mud peat' AND "SUB_ROCKS" ='sand mud'

enter image description here

After I clicked on apply, nothing was highlighted.

Any idea how can I do this?

1 Answer 1

5

I think it is always better to include the text from your Select By Attributes dialog and error message rather than pictures to aid future searches by people who may encounter the same problem but from your picture it looks like changing:

"SUB_ROCKS" 'sand mud'

to:

"SUB_ROCKS" = 'sand mud'

should address this instance of the error message you see.

Your second issue of nothing being highlighted after correcting the above should be addressed by improved logic where the elegant suggestion of @FaridCher looks right to me:

"MAIN_ROCK"='gravel' AND "SUB_ROCKS" in ('mudstone tephra loess','sand mud','sand mud peat','sandstone mudstone tephra silt lignite','sandstone siltstone mudstone limestone silt lignite') 
9
  • 4
    I would mention here the in operator... SUB_ROCKS in ('sand mud peat','other') is the same as writing SUB_ROCKS = 'sand mud peat' OR SUB_ROCKS = 'other'.. it doesn't make a difference to your selection but the text is much shorter and easier to debug. Commented Sep 11, 2015 at 0:57
  • 1
    Michael suggestion is right. But In operator is for OR conditions and not AND. Commented Sep 11, 2015 at 0:59
  • 2
    building on top of Polygeo answer, you should use OR instead of AND for SUB-Rock conditions, because a subrock can not be all of the types you have included in your query Commented Sep 11, 2015 at 1:00
  • 2
    SO the nice and proper query would be: "MAIN_ROCK"='gravel" AND "SUB_ROCKS" in ('mudstone tephra loess','sand mud','sand mud peat','sandstone mudstone tephra silt lignite','sandstone siltstone mudstone limestone silt lignite') Commented Sep 11, 2015 at 1:02
  • 3
    there is typo change "MAIN_ROCK"='gravel" to "MAIN_ROCK"='gravel' Commented Sep 11, 2015 at 1:09

Your Answer

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

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