Hello,
Any help appreciated. This code should perform a internal rate of return (IRR) calculation. It generates correct data based on what was provided to me using Excel's IRR function.
It looks like as GETDATE() gets close to my hard coded date the error is generated. Any suggestion to prevent the error would be appreciated.
SELECT
POWER
(
CONVERT(FLOAT,CONVERT(DECIMAL(30,6),322.000000)/NULLIF(4.079000,0)),
CONVERT(FLOAT,365)/COALESCE((NULLIF(DATEDIFF(d,GETDATE(),'2023-06-30'),0)),365)
)
-1