I presume you want a function that returns the spelled day of the week of the first day of the month for a given date, is that correct? If so, here is the code for such a function:
create or replace function first_day (date_in in date) return varchar2 is
begin
return to_char(to_date('01'||to_char(date_in,'-mon-yy'),'dd-mon-yy'),'DAY');
end;
/
Function created.
select first_day(sysdate) from dual;
MONDAY
Is that what you wanted? If not, could you please clarify.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.