Page 1 of 1

Date Arithmetic

Posted: Tue Mar 30, 2004 11:51 am
by rggoud
Hi,

How to do Date Arithmetic in Parallel ? Say Incrementing Input Date Fields by 1. When i tried to use DateFromDaysSince i got the following compiler error...

##E TFCP 000007 11:48:30(001) <transform> Error when checking composite operator: Parsing parameters "" for conversion "date=date_from_days_since[**********](int32)": APT_Conversion_Date_DaysSince: Invalid Date [] used for date_from_days_since type conversion
##E TFCP 000007 11:48:30(002) <transform> Error when checking composite operator: Parsing parameters "" for conversion "date=date_from_days_since[**********](int32)": APT_Conversion_Date_DaysSince: Invalid Date [] used for date_from_days_since type conversion
##E TFSR 000019 11:48:30(003) <main_program> Could not check all operators because of previous error(s) (TestRead.Transformer_192)


Transformer Code...

If RunningDt = StringToDate("01/01/1900","%mm/%dd/%yyyy") then DateFromDaysSince(1,StringToDate("01/01/1900","%mm/%dd/%yyyy") ) else
DateFromDaysSince(2, StringToDate("01/01/1900","%mm/%dd/%yyyy"))


Thanks in advance.

Raj.

Re: Date Arithmetic

Posted: Wed Oct 05, 2005 5:29 am
by dxp
rggoud wrote:Hi,

How to do Date Arithmetic in Parallel ? Say Incrementing Input Date Fields by 1. When i tried to use DateFromDaysSince i got the following compiler error...

Raj.

GOT ANSWER FOR UR PROBLEM.?? ..IF NOT JUST MAIL ME. I HAVE THE ANSWER FOR THIS QUESTION.

Posted: Wed Oct 05, 2005 6:03 am
by ArndW
dxp,

why don't you post the answer so that others are helped?

It looks like the first DateFromDaysSince() function has an invalid first argument, '1' is not a date.

date arithmetic

Posted: Mon Oct 10, 2005 5:29 am
by dxp
ArndW wrote:dxp,

why don't you post the answer so that others are helped?

It looks like the first DateFromDaysSince() function has an invalid first argument, '1' is not a date.
hi ArndW,

my machine was giving some problems, so late reply...

initial value of testdate1=2005-06-01

testdate2:int32=days_since_from_date["2005-05-01"](testdate1)------->(in Modify Stage...Specification property)

testdate3=testdate2+1-------->(in Transformer Stage)

testdate4:date=date_from_days_since["2005-05-01"](testdate3)------->(in Modification Stage........Specification Property)

testdate4=2005-06-02-------------->(final output....date increased by 1-day)


Note:-in place of quoted date..."2005-05-01"...any value of this format can be given. it works. output wont be wrong.


...dxp.

Posted: Mon Oct 10, 2005 12:34 pm
by als110
I would just convert the date to a julian day and add 1 then convert it back