Min & Max Values in a Query

G

Glynn Taylor

Using Access 2003 I have a query which extracts furnace temperatures within a
given date range.

The query feeds a report.

How can I show the minimum and maximum temperatures on the report?
 
D

Douglas J. Steele

I think the easiest way would be to have a second query that only returns
the min and max, and use that for a subreport:
 
T

Tom Lake

Glynn Taylor said:
Using Access 2003 I have a query which extracts furnace temperatures
within a
given date range.

The query feeds a report.

How can I show the minimum and maximum temperatures on the report?

Use the DMin and DMax functions. Let's say your temperature is in a field
called Temp which is in a table called Furnace Temps. You create an unbound
control for the minimum with the following as Record Source:

=DMin("[Temp]", "Furnace Temps")

and another for the maximum:

=DMax("[Temp]", "Furnace Temps")

Tom Lake
 
T

Tom Lake

Douglas J. Steele said:
I think the easiest way would be to have a second query that only returns
the min and max, and use that for a subreport:

So the DMin and DMax idea was not good? You know more about these things
than I do.

Tom Lake
 
T

Tom Lake

Using Access 2003 I have a query which extracts furnace temperatures within a
given date range.

The query feeds a report.

How can I show the minimum and maximum temperatures on the report?

Use the DMin and DMax functions. Let's say your temperature is in a field called
Temp which is in a table called Furnace Temps. You create an unbound control for
the minimum with the following as Record Source:

=DMin("[Temp]", "Furnace Temps")

and another for the maximum:

=DMax("[Temp]", "Furnace Temps")

For the date range you'd use the name of the query rather than the name of the table!
I missed that point the first time.

Tom L
 
G

Glynn Taylor

Thank you all - I've userd the Min & Max statemenst on unbound fields in the
report footer

Tom Lake said:
Glynn Taylor said:
Using Access 2003 I have a query which extracts furnace temperatures
within a
given date range.

The query feeds a report.

How can I show the minimum and maximum temperatures on the report?

Use the DMin and DMax functions. Let's say your temperature is in a field
called Temp which is in a table called Furnace Temps. You create an unbound
control for the minimum with the following as Record Source:

=DMin("[Temp]", "Furnace Temps")

and another for the maximum:

=DMax("[Temp]", "Furnace Temps")

Tom Lake
 
D

Douglas J. Steele

Tom Lake said:
So the DMin and DMax idea was not good?

Actually, it should work fine. The subreport was simply the first thing that
came to mind.
 
Top