Roger's Access Library Homepage
Forum Home Forum Home > Roger's Access Library > Roger's Download Samples
  New Posts New Posts RSS Feed - Median.mdb (intermediate)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login


Please consider donating $1 per sample downloaded, (find out why here)

Median.mdb (intermediate)

 Post Reply Post Reply
Author
Message
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP


Joined: 20 Feb 2008
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Topic: Median.mdb (intermediate)
    Posted: 31 Jul 2008 at 11:16pm
 Please consider donating $1 per sample downloaded, 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):
uploads/5/Median2K.zip
Access 97 (28 KB): uploads/5/Median97.zip

Please consider donating $1 per sample downloaded, find out why here.<
Back to Top
Sponsored Links


Back to Top
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP


Joined: 20 Feb 2008
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Posted: 26 Aug 2011 at 9:14am
8/25/2011
 
FIX: Removes records with NULL values in the Field from the recordset.
Please consider donating $1 per sample downloaded, find out why here.<
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down