Day, Month, and Year values from PL/SQL8 [message #365504] |
Tue, 21 July 1998 13:34  |
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  |
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;
|
|
|