Amended original post to add permnum limitation.
declare @denom int
declare @num int
declare @aver float
declare myfetch cursor for select permnum, cola, colb, colc, cold from rmx
declare @myfetch nvarchar(10)
declare @myfetcha varchar(2)
declare @myfetchb varchar(2)
declare...