date convert in sql code example
Example 1: sql to char function with date
SELECT
TO_CHAR( sysdate, 'YYYY-MM-DD' )
FROM
dual;
Example 2: sql server convert string to date
Cast( '2011-07-07' as date ) as convertedDate
SELECT
TO_CHAR( sysdate, 'YYYY-MM-DD' )
FROM
dual;
Cast( '2011-07-07' as date ) as convertedDate