To me it looks like you will have to write stored procedure, to handle the case of If there is an uneven Quantity versus Student count, then the credits will be allocated from top to bottom, adding an extra to each of those students.
I cannot think of a single query (like some join) possibly doing it. Another thing I noticed is, you need to give a sample of input (records from 2 tables) and output expected. Your question is not all that clear to me
padtes
Junior Poster in Training
86 posts since Aug 2009
Reputation Points: 53
Solved Threads: 20