NPV

  • Thread starter Thread starter Michelle
  • Start date Start date
M

Michelle

Does anyone know how to use the Net Present Value
function with a query?
 
I think the short answer is, you can't.

The long answer is that because the values() parameter is a ParamArray, you
need to write code to specify an array of parameters. This is not possible
from a query. BUT, your query CAN call a "wrapper" function and pass some
value, that could then be passed to the NPV function. The result can then
get passed back to the query.

Query: Select MyNPV(table.rate) from table

Code:
Function MyNPV(pdblRate as Double) as double

dim arrVals as double

arrVals(0) = -200
arrVals(1) = 450

MyNPV(pdblRate, arrVals())

End Function

If you need more sophisticated values in the area, then use more code to
generate.

--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top