AnsweredAssumed Answered

arcpy.Select_analysis - Multiple conditions for where_clause

Question asked by rayhardja on Nov 5, 2019
Latest reply on Nov 6, 2019 by rayhardja

Hello,

What is the proper syntax for where_clause when I have multiple conditions?

 

This is what I got when I exported from my model builder:

 

arcpy.Select_analysis(in_features = Pipe_Table__WGS_PIPE_,
                                    out_feature_class = WGS_PIPE,
                                    where_clause = "PIPE_DIAMETER <= 20 And SYS_ZONE <> 0 And OWNER = 'WDD' And USE_TYPE IN ('DIST', 'TRUNK', 'LSLATERAL', 'MANIFOLD') "

                                     )

The above returns me an error.

 

However, if I just do one condition such as the following below, it works... 

arcpy.Select_analysis(in_features = Pipe_Table__WGS_PIPE_, 
                                    out_feature_class = WGS_PIPE, 
                                    where_clause = "PIPE_DIAMETER <= 20" )

 

Can anyone please help? Thanks! 

Outcomes