Friday, January 22, 2021

Conditionally Fiscal year in oracle PL/SQL Function

 create or replace FUNCTION       get_fin_yr ( p_date date ) return varchar2

is 

v varchar2(100);

begin

null;

if to_char(p_date,'mm') between 7 and 12 then 

v:= to_char( p_date,'rrrr') ||'-'|| substr(  to_number( to_char( p_date,'rrrr'))  +1,-2) ;

else 

v:= ( to_number( to_char( p_date,'rrrr')) -1 )||   '-'|| substr(  to_number( to_char( p_date,'rrrr'))  ,-2) ;

end if;

return v;

end;

No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...