NPV

  • Thread starter Thread starter Michelle
  • Start date Start date
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
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Back
Top