Home » SQL & PL/SQL » SQL & PL/SQL » Day, Month, and Year values from PL/SQL8
Day, Month, and Year values from PL/SQL8 [message #365504] Tue, 21 July 1998 13:34 Go to next message
Dave Skowron
Messages: 2
Registered: July 1998
Junior Member
I need to get the numeric values of the day, month, and year from a date column. Is there any way to do this other than paarsing out the value? I need it so I can determine which of our fiscal quarters an employee was hired in, and how many days he or she has left to work in the fiscal year.

Thanks in advance,
Dave Skowron
dskowron@kleinfelder.com
Re: Day, Month, and Year values from PL/SQL8 [message #365586 is a reply to message #365504] Wed, 30 December 1998 17:03 Go to previous message
greg at voyager
Messages: 1
Registered: December 1998
Junior Member
in pl/sql
if needed in sql select stmnt, put code into
server side function and just call it to do parse

day_val := to_number(to_char(date_val,'dd'));
month_val := to_number(to_char(date_val,'mm'));
year_val := to_number(to_char(date_val,'yyyy'));

create or replace function date_to_num(indate in date, inval in varchar2) return number is
begin
return to_number(to_char(indate,inval));
-- inval is mm or dd or yyyy
end;
Previous Topic: non-alpha,non-numeric characters
Next Topic: Re: ORA-01704 "String Literal Too Long"
Goto Forum:
  


Current Time: Thu Jun 17 18:36:20 CDT 2021