PDA

View Full Version : Query with Highest 25 values of a field



nepotist
10-13-2008, 07:21 AM
Hi , I want to write a query that would return only top 25 records that have a max value of a field .
In other words, I want to see which records have the top 25 values in a field
Did I make sense.
I know that in design view there is option where in I can see a certain number or percent of records.. but i dont think that can be used here . Can any one help me with suggestions
My SQL Statement is as follows
SELECT TOP 25 tblConcurrencySegments.SegmentID, tblConcurrencySegments.RoadName, tblConcurrencySegments.From, tblConcurrencySegments.To, tblConcurrencySegments.Jurisdiction, tblConcurrencySegments.Length, tblConcurrencySegments.AreaType, tblConcurrencySegments.FunctionalClass, tblConcurrencySegments.NumberLanes, tblConcurrencySegments.MinLos, tblConcurrencySegments.Capacity, tblConcurrencySegments.PkHourPkDirVol, tblConcurrencySegments.PkDir, [permitted]+[Reserved]+[encumbered] AS Committed, tblConcurrencySegments.AvailCapacity, tblConcurrencySegments.FinalLOS
FROM tblConcurrencySegments;


and I want to see only the top 25 segments that have higher values of committed.

Thanks for your time

nepotist
10-13-2008, 08:24 AM
Sorry I figured it out..
It is Solved :D