gmmastro I am still having a problem,you provided me with this code it works great for a single value, when I try to select from my lookup table I get a error message that says
Subquery returned more than 1 value. This is not permitted.
What am I missing? Thank you
Declare @rd VarChar(20), @Output VarChar(20)
Declare @number Table(Digit Char(1))
Set @rd = (select numdata from numbers)
Insert Into @number
Select SubString(@rd, Number, 1) As Digit
From master..spt_values
Where Type = 'P'
And Number Between 1 And Len(@rd)
Set @Output = ''
Select @Output = @Output + Digit
From @number As Digits
Order By Digit
Select @Output
Subquery returned more than 1 value. This is not permitted.
What am I missing? Thank you
Declare @rd VarChar(20), @Output VarChar(20)
Declare @number Table(Digit Char(1))
Set @rd = (select numdata from numbers)
Insert Into @number
Select SubString(@rd, Number, 1) As Digit
From master..spt_values
Where Type = 'P'
And Number Between 1 And Len(@rd)
Set @Output = ''
Select @Output = @Output + Digit
From @number As Digits
Order By Digit
Select @Output