Page 1 of 1

date conversion

Posted: Thu Sep 22, 2011 12:25 am
by harikumar
Hi ,

I have source format like 1456(2007-10-01) and in target i want to populate date as 20071001.

I have gone through the search but i didn't.

Thanks,
Harikumar

Posted: Thu Sep 22, 2011 12:53 am
by premupdate
Have you tried OCONV function..

Posted: Thu Sep 22, 2011 1:07 am
by ray.wurlod
You have to extract the date portion from the input string, perhaps using substring if the size is constant or Field() functions otherwise. Then all you need to do is to convert the hyphen characters to empty string ("") in the result.

Code: Select all

Convert("-", "", Field(Field(InLink.TheString, ")", 1, 1), "(", 2, 1))

date conversion

Posted: Thu Sep 22, 2011 1:22 am
by harikumar
premupdate wrote:Have you tried OCONV function..
I have choosed mistakenly server edition but this prob related to parllel edition

Posted: Thu Sep 22, 2011 1:51 am
by ray.wurlod
My solution will work with either edition.

Re: date conversion

Posted: Thu Sep 22, 2011 2:20 am
by BI-RMA
Hello harikumar,

Is your input value a date-format as shown in the view-data grid of for example a DB2-stage (even though I would expect the numeric value to be 14519 then)?

If your column is in date-format you can convert it using DateToString(%date%,"%yyyy%mm%dd"). This will return the string '20071001' (not a date).