Solved

Using the max function in MS access query

Posted on 2008-09-30
3
769 Views
Last Modified: 2008-10-01
I have an access query that shows system number and coat.  If I have a system number of 1 and a coat of 1 and a system number of 1 and a coat of 2, how do I write that in my query to only show the system number 1 with the max coat target?  I can also have a system number 2 or 3 or 4 with multiple coats, and I only want to see the max of those also.
0
Comment
Question by:sannunzi
  • 2
3 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22609272
select [system number], max([coat])
from tableX
group by [system number]
0
 

Author Comment

by:sannunzi
ID: 22609452
That doesn't work.  I also have a field that is called die that should be displayed also along with a coat date.  The coat date is linked to the max coat, but I can't get that to work either.  I just want the query result to show the system number with the max coat and the die.  I could have rows with multiple records that have system number 1 and die 25 for example but have coat 1,2,3
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 22609567
sannunzi,
you just mentioned [system number] and coat.  now, you are adding another field.

what are the values in the field die?

select [system number], max([coat]),[die]
from tableX
group by [system number],[die]
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question