Here is some code, I wrote it so you can plug in the band# and it will return what it would be for every issue_bassis to illustrate how you can use it.Declare @BandNo intset @BandNo = 100000declare @cband table (issue_basis int,band_amount int,band_number int)insert @cband select 251,99999,01 UNION ALLselect 251,249999,02 UNION ALLselect 251,999999,03 UNION ALLselect 251,999999999,04 UNION ALLselect 252,99999,01 UNION ALLselect 252,249999,02 UNION ALLselect 252,999999,03 UNION ALLselect 252,999999999,04 Select Issue_Basis, Band_Numberfrom(Select row_Number() over (Partition by aa.issue_Basis order by aa.Band_Amount) as RowID,*from@cband aawhere aa.band_Amount > @BandNo) awhere a.RowID = 1
Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881