I am running a query that is re-sorting (reprioritizing) a simple work order table based on the table’s 4 priority-setting fields. How can I add a new column to the query that is an incrementally-numbered sequence - similar to pulling the row number? The "Work Order" id field originally was an autonumber primary key, but I want to replace it with this "sequence" field as the new primary key.
I've read various FAQs but don't find exactly what I'm looking for, and I think it's because i'm using ORDER to resort so many fields. Or it's because I'm obviously not a programmer.
Here is my current Code:
SELECT Scheduling.[Work Center ID], Scheduling.[BackorderDollars], Scheduling.Startdate, Scheduling.[PRIORITY DESCR], Scheduling.[Work Order]
FROM Scheduling
ORDER BY Scheduling.[Work Center ID], Scheduling.[BackorderDollars] DESC , Scheduling.Startdate, Scheduling.[PRIORITY DESCR];
All I want to do is add one more column called "Sequence" and use it as the new Primary Key.
Thanks in advance.
I've read various FAQs but don't find exactly what I'm looking for, and I think it's because i'm using ORDER to resort so many fields. Or it's because I'm obviously not a programmer.
Here is my current Code:
SELECT Scheduling.[Work Center ID], Scheduling.[BackorderDollars], Scheduling.Startdate, Scheduling.[PRIORITY DESCR], Scheduling.[Work Order]
FROM Scheduling
ORDER BY Scheduling.[Work Center ID], Scheduling.[BackorderDollars] DESC , Scheduling.Startdate, Scheduling.[PRIORITY DESCR];
All I want to do is add one more column called "Sequence" and use it as the new Primary Key.
Thanks in advance.