|
|
|
Re: sql developer seprate date and time [message #569819 is a reply to message #569807] |
Fri, 02 November 2012 01:01   |
 |
Littlefoot
Messages: 21825 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
tartar wrote on Fri, 02 November 2012 00:59how can i do to show just date info in 'date' and same for the 'time'?
As you were told, DATE datatype contains both date and time.
But, as you want to show them separately, TO_CHAR might solve the problem:
SQL> select sysdate,
2 to_char(sysdate, 'dd.mm.yyyy') date_only,
3 to_char(sysdate, 'hh24:mi:ss') time_only
4 from dual;
SYSDATE DATE_ONLY TIME_ONL
------------------- ---------- --------
02.11.2012 07:01:11 02.11.2012 07:01:11
SQL>
|
|
|
|
|
Re: sql developer seprate date and time [message #569876 is a reply to message #569808] |
Fri, 02 November 2012 12:38   |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
tartar wrote on Thu, 01 November 2012 20:02ps: and i also tried to_char('10/12/2010','DD/MM/YYYY'),to_char('15:00:00','HH24:MI:SS'), but it didn't work at all.
TO_CHAR on a character string is pointless and as you see in your case, does not work.
|
|
|
Re: sql developer seprate date and time [message #569887 is a reply to message #569860] |
Fri, 02 November 2012 14:51  |
 |
Littlefoot
Messages: 21825 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
tartar wrote on Fri, 02 November 2012 15:35it's the prof who insists showing date and time seprately in the table
Perhaps you should tell him/her that that can't be done - not smart way, that is. You could, of course, create a VARCHAR2 datatype columns and put result of TO_CHAR function (one for date, another for time) into each of them. But that's really useless because - what can you do with those values (except looking at them thinking how pretty they are)?
|
|
|