Thank you...now that makes sense to me why one would say this function is not "pure" or not of "deterministic" manner.

So any suggestion how I can accomplish this? I needed to use 'RR' because the values on the column has '98' thru '02'.

I suppose creating a user-defined function might solve my issue, but how? I'm not the best at creating functions...

THanks