date converstion

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
dsdv78
Participant
Posts: 17
Joined: Mon Jan 07, 2008 4:58 am
Location: chennai

date converstion

Post by dsdv78 »

Hi All,


I have small doubt regarding date converstion... i want to convert string to date in transformer stage..Can any help this one...

Thanks
DSDV
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What is your small doubt? Have you tried using... StringToDate()?
-craig

"You can never have too many knives" -- Logan Nine Fingers
dsdv78
Participant
Posts: 17
Joined: Mon Jan 07, 2008 4:58 am
Location: chennai

Post by dsdv78 »

Hi,
I tried string to date and also date to string...
my source contain like that.12/02/1990 0.00009
i want to in target like that.12/02/1990


Thanks
chulett wrote:What is your small doubt? Have you tried using... StringToDate()? ...
DSDV
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Your input string looks like it contains timestamp.
If yes, convert it to timestamp and then to date
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post by AmeyJoshi14 »

:idea: You can use substring...as well :wink:
In the transformer define stage variable(varchar) and in that use substring function as :
Link.Column_name[1,10]
and assign this value of the stage variable to desired column.
gnan_gun
Participant
Posts: 30
Joined: Thu Aug 02, 2007 5:31 am
Location: Mumbai, India

Post by gnan_gun »

Here No need of Stage variable.

In Transformer target column derivation just give as inputcolumn[1, 10] and target column datatype should be date(10).
Post Reply