AnsweredAssumed Answered

Monthly Cost Plan is not populating correctly from slice tables

Question asked by mailtojustine on Feb 7, 2017
Latest reply on Feb 8, 2017 by mailtojustine

Hi,

 

I have created an NSQL query based Portlet which shows project financial information. In the Portlet there is a column for the sum of cost plan values for the current year. I am using the below query for getting the monthly cost sum, but the values are not populating accurately. For example, instead of 20000 I am getting 19999.999990. Can anyone help me on this?

 

select datediff(dd,TSL.START_DATE,TSL.FINISH_DATE)*TSL.SLICE, TSL.START_DATE,TSL.FINISH_DATE
from niku.niku.FIN_PLANS fp inner join niku.niku.FIN_COST_PLAN_DETAILS fpd on fpd.PLAN_ID=fp.ID
inner join niku.niku.ODF_SSL_CST_DTL_COST tsl on tsl.PRJ_OBJECT_ID=fpd.ID
inner join niku.niku.INV_INVESTMENTS i on fp.OBJECT_ID=i.ID
where YEAR(tsl.START_DATE)= YEAR(getdate())

and fp.PLAN_TYPE_CODE='forecast' and fp.IS_PLAN_OF_RECORD=1and  i.CODE = '*********'

order by TSL.START_DATE

 

And the result set I am getting is,

 

CostOfMonthSTART_DATEFINISH_DATE
15000.0000082/1/20173/1/2017
19999.9999903/1/20174/1/2017
9999.9999904/1/20175/1/2017

 

The CostOfMonth values should be 15000, 20000, 10000 for Feb, Mar, Apr respectively.

Outcomes