Following on from the last post it would be easy to say, the forecast report doesnt work, we know that so lets just bear that in mind. Or you could have what I have, a customer demanding a report which reflects accurate figures. So if you want to get a report with the right figures then you can use this SQL:
SELECT
asset_no, description, depn_code AS life, transfer_date, transfer_period,
capital_value, depn_code - pers_deprcd_so_far AS periods_left, asset_wdv AS nbv,
pers_deprcd_so_far,
CASE WHEN pers_deprcd_so_far = 0 AND transfer_period <> (LEFT(scheme.GetCurrentSagePeriod(GETDATE()), 3) +
RIGHT(scheme.GetCurrentSagePeriod(GETDATE()), 2)) THEN datediff(m, transfer_date, GETDATE()) ELSE 0 END AS catchup,
CASE WHEN transfer_date < GETDATE() THEN
CAST(CASE WHEN depn_code - pers_deprcd_so_far = 0 THEN 0
ELSE asset_wdv / (depn_code - pers_deprcd_so_far) END AS money) ELSE 0 END AS forecast
FROM
scheme.famastm
ORDER BY
asset_no
I have also wrapped this into a SQL reporting services report, available free if you email me here.



















No Comment Received
Sorry the comment area are closed for non registered users