Friday, March 23, 2012

Problem in a derived column

Dear Friends,

I have an derived column in an ETL, that use the DateDiff function.

The experssion of the derived column is:

DATEDIFF("d",RKData,MaturityDate) / 365

The problem is that the result always come as an integer, and in fact the result of the expression usually has decimal numbers.. :-(

I defined the new colum of derived column as doube-precison float [DT_R8]....

Someone help me?

Thanks!

PedroCGD wrote:

Dear Friends,

I have an derived column in an ETL, that use the DateDiff function.

The experssion of the derived column is:

DATEDIFF("d",RKData,MaturityDate) / 365

The problem is that the result always come as an integer, and in fact the result of the expression usually has decimal numbers.. :-(

I defined the new colum of derived column as doube-precison float [DT_R8]....

Someone help me?

Thanks!

Try:
(DT_NUMERIC,7,4)DATEDIFF("d",RKData,MaturityDate) / (DT_NUMERIC,7,4)365

That should give you 4 decimal places. Adjust the precision and scale accordingly, if you need.|||

THANKS!!

I changed to (DT_NUMERIC,7,2)DATEDIFF("dd",RKData,MaturityDate) / (DT_NUMERIC,7,2)365 and it works!!

Thanks!!!!!!

No comments:

Post a Comment