Hello everyone,
I exported a ModelBuilder to Python where there is a FeatureLayer where I compare 2 Date Fields and it works fine in Model Builder but in Python it displays the following error message:
ExecuteError: ERROR 000230: Failed selecting with MODDATE <> MODDATE_1 \n\n
Failed to execute (MakeFeatureLayer).
This is the python code:
# Process: Make Feature Layer (5)
arcpy.MakeFeatureLayer_management(Agreement, Agreement_Layer1, "MODDATE <> MODDATE_1 \\n\\n", "", "OBJECTID OBJECTID .... ")
Solved! Go to Solution.
Have you tried it without the new line codes (\n\n) ?
"MODDATE <> MODDATE_1"
Have you tried it without the new line codes (\n\n) ?
"MODDATE <> MODDATE_1"
And if you remove the " \n\n", does it work? The \n refers to additional <Enter> you entered in the expression.
The alternative is to run the tool manually and copy the Python snippet from the Results window:
Thank you all!! Removing the \n\n" fixed the problem.