0

I have a query where it pulls the ID and Employee columns and I am trying to get Access to populate the data as shown in the 'OrderCol1' and 'OrderCol2' columns of the table below. As I'm sure you picked up from the example below, I need to have OrderCol1 just increment up 1 each time the Employee changes. And I need OrderCol2 to increment up one while Employee stays the same, and every time it changes, make OrderCol2 start back over at 1.

Is there a way to do this in a query?

example

2
  • With SQL Server's full SQL support, I'd look into GROUP BY, OVER and PARTITION for a start. Not sure if Access supports those; it should do GROUP BY just fine, but OVER and PARTITION are somewhat more advanced features that may not be supported. – user Jan 10 '15 at 13:24
  • Those clauses/functions are great in SQL (and would be perfect for this situation), but unfortunately this solution has to come within MS Access. – tarheel Jan 13 '15 at 4:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.