?
Solved

Find Max Value MS Access 2003

Posted on 2011-02-16
2
Medium Priority
?
341 Views
Last Modified: 2012-05-11
I am trying to find the max value in the Current column using ms access.
Table
ID    Name    Current
1      A           1
1      B           23
1      C           12  
2      A            22
2      B            9

So my end result with be the following:
ID  Name Current
1    B        23
2    A        22
0
Comment
Question by:asarda
  • 2
2 Comments
 
LVL 58

Expert Comment

by:cyberkiwi
ID: 34909961
select id, name, max(current) as maxcurrent
from tblname
group by id, name
0
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 2000 total points
ID: 34910008
Fixed

select g.id, MIN(name) as [Name], g.[Current]
from
(
select id, max([current]) as [Current]
from tblname
group by id
) g inner join tblname t on t.id=g.id
where g.[Current] = t.[Current]
group by g.id, g.[Current]
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

839 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