Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting year portion of date

Status
Not open for further replies.

posiedon

Programmer
Mar 22, 2002
8
0
0
GB
Hi

I wish to select the distinct year from a series of rows in a table. the date column is in the format dd:mon:yyyy:hh24:mi:ss, how do i retrieve the distinct year part from these rows?


Thanks in advance

Stephen
 
u can convert it into a chr string, and format thus:

select to_char(sysdate,'yyyy') from dual;

br,
Neil.
 
Hi Stephen,
Pls try the following
"Select to_char(your_date_column_name,'yyyy') from your table_name"

Best Regs,
~ Parthi
 
To leave the type of your DATE column use

select distinct trunc(<your_column>,'Y')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top