Advertisement
Guest User

Future Value Function

a guest
Oct 9th, 2019
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.27 KB | None | 0 0
  1. CREATE FUNCTION ufn_CalculateFutureValue(@SUM DECIMAL(18, 4), @yearlyInterestRate FLOAT, @numberOfYears INT)
  2. RETURNS DECIMAL(18, 4)
  3. AS
  4. BEGIN
  5.     RETURN @SUM * POWER((1 + @yearlyInterestRate / 100), @numberOfYears)
  6. END
  7.  
  8. SELECT dbo.ufn_CalculateFutureValue(1000, 10, 5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement