Solved

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

Posted on 2010-11-20
3
697 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
  • 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This very simple solution applies to a narrow cross-section of the "needs to close" variety. In this case, the full message in Event Viewer was in applog, Event ID 1000: Faulting application iexplore.exe, version 8.0.6001.18702, faulting module …
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now