Page 1 of 1

Date Format DD-MM-YYYY

Posted: Sun Mar 27, 2011 10:29 pm
by praburaj
Hi,

In my source file one of the column is Date. My requirement is If any Date Format is DD-MM-YYYY then I have to load the records into target table. If records are not in DD-MM-YYYY format move the records to rejected files. Plz guide me how to Identify that the record in DD-MM-YYYY?.

Posted: Mon Mar 28, 2011 12:22 am
by jpraveen
Hi,

you can have a reject link in the target ,
so that if records are not in DD-MM-YYYY format the records go to reject file.

Posted: Mon Mar 28, 2011 12:44 am
by ray.wurlod
In a Transformer stage, IsValid("date", inLink.TheDate, "%dd-%mm-%yyyy")

Posted: Mon Mar 28, 2011 1:35 am
by praburaj
Thanks Ray. I fixed my problem :D

Posted: Fri Apr 01, 2011 5:43 am
by premupdate
Hi,

When I tried to validate the date format of YYYY-MM-DD through IsValid function I can see only two values that can be passed to IsValid function.
IsValid(%typestring%,%valuestring%)
If I give the date format as third value to the IsValid function it throws basic syntax error.

Posted: Fri Apr 01, 2011 9:59 am
by zulfi123786
use a stage variable and split-concatenate the incoming data to bring it to the format YYYY-MM-DD format and then use "Isvalid" function over the stage variable.

stage varaible=X[7,4]:'-':X[4,2]:'-':X[1,2]
Constraint=Isvalid('DATE',stage varaible)