Page 1 of 1

DATE

Posted: Wed Jun 09, 2010 12:11 am
by karry450
Hi Friends,

I am getting a column(DATE)Timestamp in transformer stage say ex 29-05-2010 06:00:00 I want to add +4 days in the transformer stage.

when I say DATE+4 in transformer stage it doesnt work can anyone help me with function or the way to add 4 days for the input DATE


Thanks

Posted: Wed Jun 09, 2010 12:20 am
by ray.wurlod
You will need to separate the date and time components. Get these date arithmetic routines and add 4 days to the date, then re-assemble the time portion onto the end.

Or:

Code: Select all

Oconv(Iconv(Field(InLink.MyTimestamp," ",1,1), "DYMD") + 4, "D-YMD[4,2,2]") : " " : Field(InLink.MyTimestamp," ",2,1)

Posted: Wed Jun 09, 2010 12:45 am
by karry450
ray.wurlod wrote:You will need to separate the date and time components. Get these date arithmetic routines and add 4 days to the da ...
Hi Ray,

I dont have the premium membership can you please help me with the code

Thanks

Posted: Wed Jun 09, 2010 1:56 am
by ray.wurlod
Hi karry450

I don't have a desire to have DSXchange die through lack of funding can you please obtain a premium membership?

Thanks

Posted: Wed Jun 09, 2010 6:42 am
by chulett
He did help. The rest is up to you... or any of the thousands of other people here could chime in as well.

Posted: Wed Jun 09, 2010 7:48 am
by priyadarshikunal
Even if you don't have premium membership, you have the lead from that small portion.

Only thing is you need to have understanding of Iconv and oconv function.

you need to split date part and time part and add 4 days to date and then concatanate with time part.

IConv of date returns a number which is number of days from 1970. So adding 4 to that you will get date+4 and then convert it to date format using OConv.

Posted: Wed Jun 09, 2010 7:51 am
by priyadarshikunal
Sorry for not posting the exact code, but in case you dont want to write it on your own, please hire someone who can or get the premium membership to look at Ray's post.

Try it, its quite simple to write that code.

EDIT:- by the way click on the link to get routines written by Ray to make the task easy.