Home » SQL & PL/SQL » SQL & PL/SQL » Sysdate Year
Sysdate Year [message #1101] Mon, 01 April 2002 09:18 Go to next message
Grey1
Messages: 3
Registered: April 2002
Junior Member
Is there a way I can pull just the current 4 digit year from sysdate?
Re: Sysdate Year [message #1103 is a reply to message #1101] Mon, 01 April 2002 09:32 Go to previous messageGo to next message
Rawlings
Messages: 2
Registered: March 2002
Junior Member
SQL> select to_date(sysdate,'MM/DD/YYYY')from dual;

TO_DATE(SY
----------
04/01/2002

or if you just want the date, you could;
SQL> select substr(to_char(sysdate,'MMDDYYYY'),5,4) from dual;

SUBS
----
2002
Re: Sysdate Year [message #1107 is a reply to message #1101] Mon, 01 April 2002 18:24 Go to previous message
Srinivas
Messages: 138
Registered: June 2000
Senior Member
Try this:-
select to_char(sysdate,'YYYY') from dual
Previous Topic: Re: How to find the Size of the Database? - Urgent.
Next Topic: to store the sql st in d/b
Goto Forum:
  


Current Time: Thu Apr 25 08:07:59 CDT 2024