I want to export a feature class to a feature class but only the ones that meet a certain criteria. I need values from field OWNER that are equal to LB and values from STATUS that are equal to ABN. I was able to export just one of the fields expression (OWNER) using AddFieldDelimiters, but I am not sure if this allows for an expression pointing to two fields. I tried adding a second field but only OWNER was successful and all values from STATUS were exported. Here is my script,
# Import system modules
from arcpy import env
# Set the workspace
arcpy.env.workspace = "Database Connections/ADMIN Edit.sde/SewerCollectionNetwork"
ArcSDE = arcpy.env.workspace
env.overwriteOutput = True
# Set local variables
inFeatures = "ssGravityMain"
outputLocation = "C:/Users/Navarro/Desktop/CAD"
outputDatabase = "CCTV.gdb"
outputDatabaseLocation = "C:/Users/Navarro/Desktop/CAD/CCTV.gdb"
outputFeatureClass = "GravityMain"
delimitedOwner = arcpy.AddFieldDelimiters(ArcSDE, "OWNER")
delimitedStatus = arcpy.AddFieldDelimiters(ArcSDE, "STATUS")
expressionOwner = delimitedOwner + " = 'LB'"
expressionStatus = delimitedStatus + " = 'ABN'"
# Creating new .gdb
# Export feature class to geodatabase
print("Exporting feature class to feature class")
Thank you in advance.