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?

4

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') 
  • 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. – Michael Stimson Sep 11 '15 at 0:57
  • 1
    Michael suggestion is right. But In operator is for OR conditions and not AND. – Farid Cheraghi Sep 11 '15 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 – Farid Cheraghi Sep 11 '15 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') – Farid Cheraghi Sep 11 '15 at 1:02
  • 3
    there is typo change "MAIN_ROCK"='gravel" to "MAIN_ROCK"='gravel' – Farid Cheraghi Sep 11 '15 at 1:09

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.