Home » SQL & PL/SQL » SQL & PL/SQL » how i can get the day from date
how i can get the day from date [message #253098] Sun, 22 July 2007 08:54 Go to next message
Messages: 28
Registered: July 2007
Junior Member
how i can get day from date for example this date 12/12/2007

how i can get the day that is 12

Re: how i can get the day from date [message #253100 is a reply to message #253098] Sun, 22 July 2007 09:12 Go to previous message
Messages: 21123
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Something like this: use the TO_CHAR function (TO_DATE is here just to convert input string 12/12/2007 to a date - you'd omit it if there was a COLUMN value you'd like to check).
SQL> select to_char(to_date('12/12/2007', 'dd/mm/yyyy'), 'dd') day from dual;


SQL> create table test (col date);

Table created.

SQL> insert into test values (to_date('12/12/2007', 'dd.mm.yyyy'));

1 row created.

SQL> select to_char(col, 'dd') from test;


Previous Topic: LAST_INSERT_ID() ?
Next Topic: problem is getting result .. I am a lazy SOB!
Goto Forum:

Current Time: Tue Jun 27 14:18:54 CDT 2017

Total time taken to generate the page: 0.11175 seconds