I want to display only year or month or date from Date colum

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
venkates.dw
Participant
Posts: 67
Joined: Mon Dec 22, 2008 4:07 am

I want to display only year or month or date from Date colum

Post by venkates.dw »

Hi,

my date format is yyyy-mm-dd hh:mi:ss . from this i want to get only either year or month or date in server jobs.

Please give me reply...

Thanks in advance....
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

I think Ray has answered to a very similar question from you. Did you try working based on his response?
sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Re: I want to display only year or month or date from Date c

Post by sbass1 »

venkates.dw wrote:Hi,
Please give me reply...
Then please give us more details. What is your source data? Is it already stored in internal date format, or is your data a text string coming from a sequential file? You may want to research the SQL convert function, and the DataStage iconv and oconv functions.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What have you tried so far?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Year or month or day, perhaps? In any case, either substring with [] or use Field() to get just the parts you want.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply