By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,550 Members | 2,757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,550 IT Pros & Developers. It's quick & easy.

Update a Table with Running Counts

P: 1
I would like to update a field in a table named ‘010 Consolidated Data’. The field that I want to update is ‘Begin Date #’. The value that I want to add to ‘Begin Date #’ depends on two other fields: a field with employee numbers, ‘Employee’, and a field with dates, ‘Beginning Date’. For each employee number, I want to count how many different Beginning Dates there are and update the ‘Begin Date #’ field with a running count. For example…if employee 1 has three different dates (on 3 rows); the first row would have a 1 in the ‘Begin Date #’ field, the second row would have a 2 and the third a 3. Employee number 2 might have two dates and the values for these two rows would be 1 and 2 respectively. I would need to update a table with roughly 400 employees and 1000 rows. I would appreciate your thoughts! Thank you!
Feb 29 '12 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 10K+
P: 12,366
First of all, don't do that. Use the running sum functionality in the reports for that or use a ranking query.

If speed is really an issue and speed is more important than data integrity, use a ranking query to update the table.
Feb 29 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.