Home » SQL & PL/SQL » SQL & PL/SQL » Setting the sysdate (hopefully easy)
Setting the sysdate (hopefully easy) [message #6935] Mon, 12 May 2003 13:37 Go to next message
Andy Grace
Messages: 9
Registered: May 2003
Junior Member
What I want to do is set the start date to be the sysdate, but I need to manipulate the sysdate so it has it appear in the format 11-MAY-2003

How can I change the sysdate function to show the date in the dd-mm-yyyy format with the mm showing name not number?

Thanks
Re: Setting the sysdate (hopefully easy) [message #6936 is a reply to message #6935] Mon, 12 May 2003 13:57 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
You can't change the actual value of sysdate, but you can wrap it with a function to return it as a string:

to_char(sysdate, 'DD-MON-YYYY')
Re: Setting the sysdate (hopefully easy) [message #6946 is a reply to message #6935] Tue, 13 May 2003 04:28 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9090
Registered: November 2002
Location: California, USA
Senior Member
Although you can use TO_CHAR to change individual displays of dates, including SYSDATE, if you want to change the default format for displaying dates, including SYSDATE, for the entire session, you can use:

ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY';
Re: Setting the sysdate (hopefully easy) [message #6951 is a reply to message #6936] Tue, 13 May 2003 09:24 Go to previous message
Andy Grace
Messages: 9
Registered: May 2003
Junior Member
thanks to both of you
Previous Topic: Job to run in say 2 mins time.
Next Topic: invoker rights, ORA-01007 variable not in select list error
Goto Forum:
  


Current Time: Thu Apr 25 19:17:53 CDT 2024