Skip to Content
0
Former Member
Dec 08, 2011 at 05:54 PM

how to get year out of a date database field

1745 Views

Hi,

I got a Oracle database field "createddate', i want get year from this field.

i Tried: to_date(to_char(createddate,'yyyy'),'yyyy')

i laso tried: trunc(createddate,'yyyy')

also tried: to_date(substr(to_chart(createddate),7,11,)'yyyy')

but when i test in Webi, i got '1/1/11' what's the right syntext?

Thanks

Edited by: hiccup on Dec 8, 2011 6:55 PM