views:

17

answers:

1

I wanna select one row of each duplicated SIDs in a field below. (an attribute table of a shape file)

The priority is R > S = I > 0

Therefore, among SID 87, FID1 will be selected.

(SID 88, STATUS will be S+I)

(SID 89, FID 6 will be chosen)

(SID 90, deleting FID 9 or 10)

Please kindly advise VBA code to implement the selection and thanks.

FID    SID    STATUS 
 1     87       R
 2     87       O
 3     88       I
 4     88       S
 5     89       I
 6     89       R      
 7     89       I
 8     89       S
 9     90       S
10     90       S
+1  A: 

You can use SQL in VBA.

Remou
Thanks but I am unfamiliar with SQL in VBA, please give more hints.Thanks
Elaine Kuo
You do not say in which Microsoft product you are trying to do this, so it is not possible to be more specific. In Excel, for example, you can use ADO and a connection string to run the query. You should consider Michael Rodrigues' comment.
Remou