1

Using ArcPy I'm Trying to Set up a Where Clause in my "FeatureClassToFeatureClass_conversion"

This {Where Clause} needs to Query Two Columns in the data:

FEATURE = 'ENVIRONMENT'

and 

TEMPERATURE > 50

I'm having a hard time doing both queries in the same expression as you would using "AND"

"\"FEATURE\" = 'ENVIRONMENT'" ?AND? "\"TEMPERATURE\" > 50"

  • PolyGeo Did a great job at answering however, here a is Detail I did not mention (Setting a Range for TEMP): ..... AND " + '"TEMPERATURE" > 50' AND "+'"TEMERATURE" <=100' .......Wondering what I'm missing on this one. THANKS! – Matthew Oct 30 '15 at 16:18
0

I think this will work:

'"FEATURE" = ' + "'ENVIRONMENT' AND " + '"TEMPERATURE" > 50'

If so the things to note are that I am concatenating three strings, and in each string I have either a pair of single or double quotes that I need to wrap another pair of the opposite type of quotes around.

There are no triple single quotes in the above but you need to pay close attention to whether I have used the single or double quote first.

| improve this answer | |
  • THIS is Detail I did not mention (Setting a Range for TEMP): ..... AND " + '"TEMPERATURE" > 50' AND "+'"TEMERATURE" <=100' .......Wondering what I'm missing on this one. THANKS! – Matthew Oct 30 '15 at 16:01

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