Stage variable
Posted: Wed Apr 30, 2008 11:02 am
I have a input column number,which is date coming in as mmddyy(12908)
i have to convert it into yyyymmdd into output number column.
If yy >10 then i append 19 to the year else 20 to the year.
So I am doing the below in 2 stage variables(of data type varchar)
sv1 If len(col1)=5 then 0:col1 else col1
sv2 If Right(sv1,2) >10 then '19':sv1[5,2]:sv1[1,2]:sv1[3,2]
ELSE '20':sv1[5,2]:sv1[1,2]:sv1[3,2]
But even though Right(sv1,2) is less than 10 ,19 is getting appended.
For the above date i am getting as out put is 19080129 where as it should be 20080129.
I got the point that Right(sv1,2) >10 is always evaluated as true.
Can some one kindly help me how to solve this.
Thanks
i have to convert it into yyyymmdd into output number column.
If yy >10 then i append 19 to the year else 20 to the year.
So I am doing the below in 2 stage variables(of data type varchar)
sv1 If len(col1)=5 then 0:col1 else col1
sv2 If Right(sv1,2) >10 then '19':sv1[5,2]:sv1[1,2]:sv1[3,2]
ELSE '20':sv1[5,2]:sv1[1,2]:sv1[3,2]
But even though Right(sv1,2) is less than 10 ,19 is getting appended.
For the above date i am getting as out put is 19080129 where as it should be 20080129.
I got the point that Right(sv1,2) >10 is always evaluated as true.
Can some one kindly help me how to solve this.
Thanks