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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distribute records dynamically

Status
Not open for further replies.

HezMac

Programmer
Jan 14, 2004
56
CA
Hi there.

I'm using a PL/SQL back end (and VB.Net front end) to develop an application that will take accounts from one employee (the Source) and reassign them to one or more than one other employees (the Destination).

It's when the accounts are reassigned to more than one employee that I'm having issues with.

For example, if one employee leaves the company and her accounts are being reassigned to four other employees, I want to have the accounts distributed by account balance, so they will be distributed somewhat equally.

For instance, if the Source account balances are: $1000, $850, $700, $600, $500, $300, $250 they would be distributed between the four employees as follows:


Employee 1st Assigned Acct 2nd Assigned Acct
Joe $1000 -
Samantha $850 $250
Erin $700 $300
Kate $600 $500


The user selects the Destination employees from a drop down list on the VB form (and adds them to a list box), so I need a way to count the employess in the list box and distribute the accounts in a descending, and then ascending way, once at the bottom of the list of destination employees.

Any ideas of where to start?

Hope this makes sense.

Thanks a bunch for any help.






 
If you have a PL/SQL backend, this needs to be posted in an Oracle forum. The syntax for microsoft SQL server's T-SQL language can be very differnt from PL/SQL.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top