Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Task assignations 1

Status
Not open for further replies.

colomtek

Programmer
Feb 6, 2012
13
US
Hello team,


I would like to have help with some ideas about how to work with two tables, in the first one will have the task number and the ID of the person who is going to have assign the task, the trick here is that the system should assign to all of the users (5) and not repeat the same task for another user.

How may I do this? if you request additional information, please let me know. Thanks in advance for the support.
 
sounds like you need an outer loop and an inner loop :

For Each Task
For Each User
Add Record
End
End

Can you post some code ?

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
The thing is that several people will save that task to the people that will have assigned the tasks, so the system needs to know who is the next available
 
colomtek:
Here is some pseudocode that may be what you're looking for, but IMO you are going to have to provide a lot more information including sample code and what you have tried so far in order to get any kind of help.

Code:
rsTasks = SELECT * FROM Tasks
rsUsers = SELECT * FROM Users
Do While Not rsTasks.EOF and Not rsUsers.EOF
   UPDATE Tasks 
      SET Tasks.UserAssigned = rsUsers("UserID")
      WHERE Tasks.TaskID = rsTasks("TaskID")
   rsUsers.MoveNext
   If rsUsers.EOF Then rsUsers.MoveFirst
Loop
 
I was able to found some example from this webpage:


This the part for doctors:

$doctors = array(
array(
'name' => 'Greg',
'patients' => array()
),
array(
'name' => 'Meredith',
'patients' => array()
)
// etc...
);



and the assignation code:
doctorIndex = 0
For each patient:
// Add the client to the slots for the
// doctor at the current index
doctors[doctorIndex]["slots"][] = patient

// Increment the doctor index, so the next
// doctor will be used on the next loop.
doctorIndex = doctorIndex + 1

// Make sure the index doesn't go higher than
// the total amount of doctors.
If doctorIndex > count(doctors):
doctorIndex = 0


The this is here is in use an array and is in php (which would not be a problem changing the code to ASP), but I would like to use, instead of an array, a recordset.

Thank you so much for your interest in helping me.
 
I haven't notice your post.

Thank you so much, will try to apply it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top