ali raza

C#, .Net , and my thoughts

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


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: