My Source data has only two digit year when i am trying to convert to timestamp
sel cast('12/12/12 00:00:00' as timestamp(0) format 'MM/DD/YYBHH:MI:SS')
tried with the current_timestamp(0)
sel cast(current_timestamp(0) as timestamp(0) format 'MM/DD/YYBHH:MI:SS')
i am getting "1912" as a year
There is a dbscontrol parameter named Century Break.
If century break is 0 then all years in YY are 19YY
If century break is 100 then all years in YY are 20YY.
A long time ago there was a so-called "year2k" problem :-)
The dbscontrol is a global setting, for this specific import you might either concat '20' to the two digit year or add 1200 months using ADD_MONTHS.
YOU CAN TRY THIS IN BTEQ UTITLITY ,IT GIVING EXPECTED O/P,I THINK THIS IS HELP FULL TO YOU
sel cast('12/12/12 00:00:00' as timestamp(0) format 'MM/DD/YYBHH:MI:SS');
Hi SK RAFI,
One of the way to do it using OLAP function.
Following query would help you to understand the same.
May be you can write a recursive or stored procedure to meet your requirements on top of it.
MAX( (CASE WHEN t1.rnk =1 THEN t1.name END) )
|| TRIM(CAST(',' AS CHAR(1))) ||
MAX( (CASE WHEN t1.rnk =2 THEN t1.name END) )
, RANK () OVER (PARTITION BY id ORDER BY name) rnk
ON t.id = t1.id
GROUP BY 1