A little additional info that might help someone out there:
In a query that has no aggregation (GROUP BY, MIN, MAX, etc), the
criteria in the WHERE clause are applied to the records at the time of
selection.
But in a query *with* aggregation, there are two options for how you
apply criteria: at the time of selection (WHERE clause) or after
grouping (HAVING clause).
As in Salad's example, the incorrect application of criteria (WHERE vs
HAVING) can have an effect on the result set of the query.
In other cases, the result set could be the same, but the
performance can be significantly affected. For instance, if you want
the Max of some value on a specific date, applying the date criterion
in the WHERE clause will weed out all but the date in which you're
interested prior to the application of the Max function. But if you
apply the date criterion in the HAVING clause, your query will select
*all* dates and calculate the Max value for each date, before
applying the date criterion and showing you only the date you're
interested in. (Unless Access/Jet has some kind of SQL optimization
built in of which I'm not aware.)
This is, IMHO, one of the places in Access where the GUI is a little
too user-friendly, and hides something significant from the user.
-Matt
On Sat, 10 Apr 2004 20:33:59 GMT, Salad <oi*@vinegar.com> wrote:
If you really have the min or max records beyond today, you need to
manually modify the query to change the word Having to Where