Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Use of MAX function in MS Access Query

Posted on 2010-11-18
3
331 Views
Last Modified: 2012-05-10
I have an MS Access table that contains two columns that looks something like :

Field A        Field B
Houses       1
Houses       2
Houses       3
Houses       4
Houses       5
Flats            1
Flats             2
Flats             3
Flats             4
Bungalows   1
Bungalows   2
Bungalows   3

I want to run a query that returns only the rows where the highest number in Field B relates to Houses, Flats, or Bungalows.  i.e. the query will return 3 rows which will contain Version 5, 4 and 3 respectively.  My real data contains an inconsistent number of versions for each category, and I just want the 'Max' (highest number) in each case and return a single row

How do I create my query please?  I would like this in Design View syntax not SQL please
0
Comment
Question by:MPWOOD
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 500 total points
ID: 34163510
See the screenshot attached for the Design View.

Sincerely,
Ed
Max.JPG
0
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 34163526
Here's the SQL Statement:

SELECT Table4.FieldA, Max(Table4.FieldB) AS MaxOfFieldB1
FROM Table4
GROUP BY Table4.FieldA;

And see screenshot when you run Query 3.

Sincerely,
Ed
Display.JPG
0
 

Author Closing Comment

by:MPWOOD
ID: 34163569
yes, it was so simple in the end !  I am so rusty on Access, I should've known that!  Thanks for your quick help.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
T-SQL Query to include null values 3 51
Oracle - Query link database loop 8 41
SQL Syntax Grouping Sum question 7 26
Current Month Filter in Visual Studio 10 23
As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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