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
Stage variable
Moderators: chulett, rschirm, roy
If you're assuming xx10 is 2010, then just check for 0 at sv1[5,1].
sv2 (If sv1[5,1]=0 then '20' else '19'):sv1[5,2]:sv1[1,2]:sv1[3,2]
sv2 (If sv1[5,1]=0 then '20' else '19'):sv1[5,2]:sv1[1,2]:sv1[3,2]
Last edited by kcbland on Wed Apr 30, 2008 11:28 am, edited 1 time in total.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
Just by looking, I would say the
Just my opinion,
John
is comparing the text string '08'>10 which must evaluate to True. You might want to change it to Right(sv1,2) > '10' and see if that works. But then again, I wouldn't do this test because in 3 years when it is 2011 your result would be incorrect...Right(sv1,2) >10
Just my opinion,
John