how to cast date in YYYYMM format using SQL in Teradata
For odbc connections (e.g if you are using sql assistant/queryman) then use:
sel cast((current_Date (format 'yyyymmdd' )) as char(8));
For native connections (e.g if you are using bteq) then use:
sel current_date (format 'yyyymmdd');
however you may use below query(same as for sql assistant) in bteq also ...
sel cast((current_Date (format 'yyyymmdd' )) as char(8));
This is how you can cast date in different formats in sql teradata. Simple :-)
0 comments:
Post a Comment