Sum, Minimum and Maximum with a twist...

N

Nicole

Hi,

I am looking to find the sum, minimum and maximum values of a field. Here's
the catch: I want to group the records and only sum/find the max and min
within those groups (creating one set of summary stats per value of x). I'm
not sure how to go about coding it, but here's what I'm trying to get:

for all values of x:

If (field1) is x, find the sum of (field2)
If (field1) is x, find the minimum of (field3)
If (field1) is x, find the maximum of (field3)

where field1 is text, field 2 is numeric, field 3 is text(some values of
field 3 are numbers stored as text).


Is there an easy way to create a table that shows the sum, min and max for
each possible X in (field1)?

Thanks in advance for any ideas/input you may have; I'm still fairly new to
Access.

Nicole
 
D

Duane Hookom

I'm not sure I understand correctly since this seems like a very basic totals
query:
SELECT Field1, Sum(Field2) as Sum2, Min(Field3) as Min3, Max(Field3) as Max3
FROM tblNoNameGiven
GROUP BY Field1;
 
N

Nicole

Thanks for the suggestion; I just figured it out. I'm still getting familiar
with Access and have an Access/SQL book on the way. Thanks for your help!

Thanks,
Nicole
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top