ali raza

C#, .Net ,Asp.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

Years

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

Months

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

Day

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

chears

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: