Hello friends, Can u help me how can i get the year part from date_1 using substring or any other way? date_1 has datatype of varchar(10), so when i tried using Extract it didn't work. date_19/21/20057/13/20011/11/20015/23/200510/15/20044/ 24/20063/24/20057/15/20032/25/20021/8/200311/25/20051/ 29/20015/19/19995/9/2002Thanks
This should work...CAST(DATE_1 AS DATE) AS DATE_1_DT,EXTRACT(YEAR FROM DATE_1_DT) I put it in two steps to make it easier to read. You should also be able to do EXTRACT(YEAR FROM (CAST(DATE_1 AS DATE))).
Hi Kavya,select substring(date_1 FROM CHAR_LENGTH(date_1) - 3)Dieter
Hey Thanks a lot. Its working great.