Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

convert string to date format - response (8) by Qaisar Aftab Kiani

$
0
0
You can check the length of the date string and convert it accordingly... SELECT '8/12/2012' AS COL1 , CASE WHEN CHAR_LENGTH(COL1) = 9 THEN CAST('0'||COL1 AS DATE FORMAT 'DD-MM-YYYY') ELSE CAST(COL1 AS DATE FORMAT 'DD-MM-YYYY') END

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>