Wednesday, June 09, 2004
Functions With Names Beginning With P
The problem with a series of posts like this one is that things only get interesting when something goes wrong. A post that says ‘I tested this, and it works, and I didn’t encounter any problems’ isn’t really very interesting, and that’s exactly what happened today. Not to worry, I will persevere, in the confident expectation that something will go wrong real soon now! :-)
There are four VBA functions with names beginning with the letter ‘P’, the Partition(), PMT(), PPMT() and PV() functions. Here’s the SQL for a query that uses all four of these functions. As always in this series, this rather strange query is not intended to return a meaningful result, it is merely a test bed for the functions:
SELECT
Partition([TestInteger],1,10,2) AS TestPartition,
Pmt([TestDouble],[TestInteger],[TestDouble],[TestCurrency],1) AS TestPmt,
PPmt([TestDouble],[TestInteger],[TestInteger],[TestDouble],[TestCurrency],1) AS TestPPmt,
PV([TestDouble],[TestInteger],[TestDouble],[TestCurrency],1) AS TestPV
FROM tblTest;As indicated above, this query executed with a boring lack of problems both within Microsoft Access and via our C# ‘JetTest’ utility (see previous posts). So we can now add these four functions to our list of VBA functions that can be used in Jet queries when executed outside of the Microsoft Access environment:
The Partition(), PMT(), PPMT() and PV() functions.
Send feedback on this post to (change the obvious):
Brendan Reynolds
bwnnfb at hotmail dot com
(For the insatiably curious, "bwnnfb" is an acronym for "Blog With No Name Feed-Back")
Copyright © 2004 Brendan Reynolds. All rights reserved.