Query x amount of records at a time

  • Thread starter The Joker via AccessMonster.com
  • Start date
T

The Joker via AccessMonster.com

Hello all!

I'm working on a task queue database. Currently the queue shows all non-
completed tasks. I'm working on a Form where people can go in and see tasks
assigned to them instead of all. What I want to do is create an update query
that will update the "Assigned to" field to the user who opens it. My main
task I'm not sure how to go about is that I only want to assign them 5 at a
time. How would I do critieria (or something) to limit the update to only 5
records at a time? Thank you!!
 
C

Clifford Bass via AccessMonster.com

Hi,

Try something like this:

UPDATE tblTasks SET tblTasks.AssignedTo = <the user's ID>
WHERE (((tblTasks.[AssignedTo]) Is Null) AND ((tblTasks.[TaskID]) In (SELECT
TOP 5 TaskID
FROM tblTasks
WHERE AssignedTo Is Null
ORDER BY TaskID)));

Adjust for your actual table and column names and the actual user's ID.

Clifford Bass
 
T

The Joker via AccessMonster.com

Thank you Clifford!

For anyone else that this may help, you can also set TOP in the query
properties.
 
C

Clifford Bass via AccessMonster.com

Hi,

You are welcome!

Clifford Bass

The said:
Thank you Clifford!

For anyone else that this may help, you can also set TOP in the query
properties.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top