format date in sql server yyyy-mm-dd in ora code example Example: sql to char function with date SELECT TO_CHAR( sysdate, 'YYYY-MM-DD' ) FROM dual;