Select to view content in your preferred language

set order on multiple fields

792
4
04-20-2011 10:00 AM
TerrySilveus
Frequent Contributor
I'm doing this

rows = arcpy.UpdateCursor("c:/gis/temp.shp","","","","POINT_X A, POINT_Y A")

I want to sort on both POINT_X and POINT_Y fields, but it doesn't seem to be working.  Can someone let me know how to sort on multiple fields in a cursor?
Tags (2)
0 Kudos
4 Replies
ChrisSnyder
Honored Contributor
Try this:

rows = arcpy.UpdateCursor("c:/gis/temp.shp","","","", "POINT_X A; POINT_Y A")

The correct sort field parameter delimiter is a ; and you were using a ,
0 Kudos
TerrySilveus
Frequent Contributor
Try this:

rows = arcpy.UpdateCursor("c:/gis/temp.shp","","","", "POINT_X A; POINT_Y A")

The correct sort field parameter delimiter is a ; and you were using a ,


That did it.  Thanks so much.
0 Kudos
DonnaBest
Deactivated User
I need to sort on multiple fields in vb.net.   Any ideas?

Thank you!
0 Kudos
TerrySilveus
Frequent Contributor
I need to sort on multiple fields in vb.net.   Any ideas?

Thank you!


In a vba (from access experience not sure how it would be in arcMap) sql statement you just use commas between fields

SELECT ... FROM ... WHERE ... ORDER BY field1, field2 ...

not sure about vb.net
0 Kudos