I feel like I'm missing something simple here. All I want to do is select a subset from a layer based on an attribute and then do a spatial join of just the subset to a polygon layer.
Script works fine, but it's executing the spatial join against the entire layer, not just the selected records.
# Execute Select
arcpy.management.SelectLayerByAttribute(asset, "NEW_SELECTION", '"COORDINATE_VALID_DATE" = CURRENT_DATE' )
#Execute Spatial Join
arcpy.SpatialJoin_analysis(asset, polygonLayer01, "asset_join_poly01", "JOIN_ONE_TO_MANY", "KEEP_COMMON", "", "INTERSECT")
Thanks