Quantcast
Channel: SQL Server Master Data Services forum
Viewing all articles
Browse latest Browse all 1311

T-SQL Stored Procedure to minic Excel Formula

$
0
0

i am working on a task which requires me to build an sql query that will simulate a formula from excel using a particular start amount that will be reducing till maturity date.

so can someone help me with the script that will simulate a formula for a particular date and apply it the same formula throughout the subsequent period till end date.

below is the excel formula,

=XNPV($C$51, Annuity!G37:$NB$37, Annuity!G41:$NB$41)

i have derived sheet c51. which runs by this query

select@rt= wct.XIRR(cf_amt, cf_date,NULL)FROM(select cf_amt, cf_date from@IRRtab) n(cf_amt, cf_date)declare@rtt as float =(select cast(@rt as float))return@rt end

sheet G37 is = 20,504.63 from excel using this formula

=IF(G41 >0, Annuity!$C61,0)

and G41 is the date.


Viewing all articles
Browse latest Browse all 1311

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>