for dat in datelist: arcpy.SelectLayerByAttribute_management ("hotspots", "NEW_SELECTION", "'date' = '%s'"%dat)
for dat in datelist: whereclause = "'date' = " + dat arcpy.SelectLayerByAttribute_management ("hotspots", "NEW_SELECTION", whereclause)
This is so simple and effective I can't believe I didn't think to use python to make the variable to just pass as the whole where_clause. I've been working forever on this and finally saw your post!