Folks
I have this table called TblCombine
Sample data
Ldg, Bnk, Combine, Dupe BQ 55.23 BQ55.23 0 BQ 65.23 BQ65.23 0 BQ 75.23 BQ75.23 0 BQ 85.23 BQ85.23 0 BQ 85.23 BQ85.23 0 BQ 85.23 BQ85.23 0 Int 95.23 Int95.23 0 Int 105.23 Int105.23 0 Int 95.23 Int95.23 0 Int 95.23 Int95.23 0
I join the Ldg and Bnk fields into the Combine field.
My problem is I need a process to Order the Combine field
Then loop through the combine field and if it's not equal to the combine field above it the Dupe field is Updated to 1, if it is equal the field above it is updated to 2 and so on,
Expected Result
Ldg, Bnk, Combine, Dupe BQ 55.23 BQ55.23 1 BQ 65.23 BQ65.23 1 BQ 75.23 BQ75.23 1 BQ 85.23 BQ85.23 1 BQ 85.23 BQ85.23 2 BQ 85.23 BQ85.23 3 Int 95.23 Int95.23 1 Int 95.23 Int95.23 2 Int 95.23 Int95.23 3 Int 105.23 Int105.23 1
I have done this in VB where in access as I can follow the process but I am lost at the moment in SQL.
Regards & Thanks
Pator