Solved

need to create a criteria to filter by max value in query select

Posted on 2010-11-20
3
712 Views
Last Modified: 2012-08-14
I tried using the max function but it's returning all the records screenshot
0
Comment
Question by:solarisinfosys
[X]
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
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 500 total points
ID: 34182069
You can use TOP 1 Query expression for that purpose. Below link will guide you how to do it.

http://www.blueclaw-db.com/accessquerysql/select_top.htm

Sincerely,
Ed
0
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 34182077

I used the same expression with some of my applications and it worked perfectly. Here's a sample sql statement on it:

SELECT Top 1 Location.LocationID, Location.State, Location.City
FROM Location
ORDER BY Location.LocationID DESC;

The result display the Max value of  LocationID with its corresponding records.

Sincerely,
Ed

0
 

Author Closing Comment

by:solarisinfosys
ID: 34185307
Thanks, it worked perfectly. Thanks for the example
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

615 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