≡ Menu

how to get year from date in pl sql

pl Sql has function “Extract” this functions works wonders. I used it at many places in my application , i write some samples here


select EXTRACT(YEAR FROM DATE ‘2008-3-17’)YEAR from dual;


select EXTRACT(Month FROM DATE ‘2009-3-17’)Months from dual;


select EXTRACT(day FROM DATE ‘2009-3-17′)Days from dual;

and how i used it my query

select * from tblSales_V where salesId in (select SalesId from OUTLET_SALE_V where outlet_Id =’001198’)
and EXTRACT(YEAR FROM issue_Date) = 2005


{ 0 comments… add one }

Leave a Comment