Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-11-20
3
Medium Priority
?
720 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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 …
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…

715 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