Print Page | Close Window

Median.mdb (intermediate)

Printed From: Roger's Access Library
Category: Roger's Access Library
Forum Name: Roger's Download Samples
Forum Description: A compendium of Microsoft Access 97 and 2000+ routines, each separated into its own sample database.
URL: www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=325
Printed Date: 15 Dec 2017 at 2:46pm


Topic: Median.mdb (intermediate)
Posted By: Roger Carlson
Subject: Median.mdb (intermediate)
Date Posted: 31 Jul 2008 at 11:16pm
 Please consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm - find out why here .
 
Median.mdb
 
Surprisingly, Access has no Median function, so you have to write one of your own. This sample database shows how to do that.

You use the function much like the built-in Domain functions (DLookUp, DMax, and so on). That is, you must provide the 1) field name, 2) table name, and 3) a 'Where' Criteria. When used in an aggregate query (see below) you MUST add each field 'grouped by' into the Where Criteria. See Help for more on Domain Aggregate functions.

There are modules that show both DAO and ADO methods, but ADO is the only method used here. Go to the appropriate module to see the code. 

Download
Access 2000 ADO (32 KB):
http://www.rogersaccesslibrary.com/forum/uploads/5/Median2K.zip - uploads/5/Median2K.zip
Access 97 (28 KB): http://www.rogersaccesslibrary.com/forum/uploads/5/Median97.zip - uploads/5/Median97.zip



-------------
Consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm" rel="nofollow - find out why here .<



Replies:
Posted By: Roger Carlson
Date Posted: 26 Aug 2011 at 9:14am
8/25/2011
 
FIX: Removes records with NULL values in the Field from the recordset.


-------------
Consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm" rel="nofollow - find out why here .<



Print Page | Close Window