Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date format

Hello:

I've been having trouble with the date format, this is my problem:

I have the following date format: 01-08-2006  0:00:00

And I just need the year (2006).

Do you have any idea of the best way to get it?

Thanks a lot

6 Replies
sunny_talwar

try this in the script if your date is MM-DD-YYYY

LOAD Year(Date#(yourDateField, 'MM-DD-YYYY h:mm:ss') as Year

if date is DD-MM-YYYY, then use this:

LOAD Year(Date#(yourDateField, 'DD-MM-YYYY h:mm:ss') as Year


HTH

Best,

Sunny

agomes1971
Specialist II
Specialist II

avinashelite

try like this:

year(Date(floor(date_feild),'MM/DD/YYYY'))

Anonymous
Not applicable
Author

Thanks alot! that worked just fine!

Anonymous
Not applicable
Author

Thanks alot! that worked just fine!

avinashelite

cool, Please mark it as answered and close this thread