Tuesday, July 1, 2008

Date Format in SQL for Oracle Database

SELECT TO_CHAR(SYSDATE, 'DD/MM/YYYY') FROM DUAL;

output sample: 01/07/2008

SELECT TO_CHAR(SYSDATE, 'MMM/YYYY') FROM DUAL;

output sample: JUL/2008

SELECT TO_CHAR(SYSDATE, 'Dy') FROM DUAL;

output : Sun

SELECT TO_CHAR(SYSDATE, 'Day') FROM DUAL;

output : Sunday

No comments: