Hi All,
I am working on laoding data to Sybase db i have three column in source table which are Tinyint(Year,Month,Day) i need to concatenate them and load it in Date(ISO:'YYYYMMDD') Format.
Example:
Source:
year(tinyint) Month(tinyint) Day(tinyint)
2000 01 22
Target:
Starting_date(date)
20000122
i am trying with following queries which did'nt worked
Note:IN Sybase we can not convert tinyint to date directly.
select CONVERT(DATE,(CAST((year*10000+month*100+day) AS VARCHAR)),112) from Table_name;
select CAST((year*10000+month*100+day) AS DATE) from Table_name;
select CAST((CONVERT(CHAR,(year*10000+month*100+day))) AS DATE) from Table_name;
getting following error:
om.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -1001006: Data exception - data type conversion is not possible.
-- (dfe_Cast.cxx 795)
Any buddy has any idea about it.
Thanks & Regards