Tuesday, February 1, 2011

New Sample: Mode.mdb

by Roger Carlson

Access has no Mode 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 this for more on Domain Aggregate functions see Domain Functions Demystified.

You can find the sample here: http://www.rogersaccesslibrary.com/forum/modemdb-intermediate_topic557.html

No comments: