Home  Fees/Services  Access Examples  Tutorials  Access Download  Articles  Search  Contact  Privacy  Links
Access Aggregate Function Examples
Statistical Calculations in Access
Standard Deviation
Access Aggregate Function Tutorial Access Min Max Count Sum Average

MS Access Tutorials>Access Aggregate Functions>DStDev & DStDevP Code



Dlookup Example
Compound Dlookup Code
DMin & DMax Examples
DStDev & DStDevP Code


DStDev and DStDevP Aggregate Functions in Access

StDev & StDevP - calculate the sample (recordset) standard deviation and an estimate of the population standard deviation.

It is nice to have some statistical measures immediately available to you with a single command.

With the standard deviation, count, and mean you can generate a large number of statistical functions such as correlation coefficients.  Combine these with the histogram example and you can also figure out kertosis and skewness.

Below is a simple example that calculates the sample and population standard deviation for the quantity shipped field.

stdev stdevp examples

Sample standard deviation code is the record source for the unbound field in the form footer:

=DStDev("Quantity","shipping")

The population statistic is as follows:

=DStDevP("Quantity","shipping")

Note that each of the statistical measure work on the entire Shipping table and ignores any filtering done on the form.

In the following example we restrict the calculations to only include those quantities for FedEx shipments:

stdev & stdevp Microsoft Access examples

The sample StDev standard deviation code is as follows:

=DStDev("Quantity","shipping","Shipper_Id=1")

And, the StDevP population calc is similar:

=DStDevP("Quantity","shipping","Shipper_Id=1")

To restrict the calculations to a subset of the shipping table records use a query as the source for the form and restrict the query based on a form field. Refer to the query name rather than the table name 'shipping' in the Dstdev code.

Contact Information

Microsoft Access Development
Microsoft Access 2007 2003 2000 2002(XP) 97 All Windows Versions