Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select top 4 records for each cusip in a table

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i have a table that contains 10 records each for a distict field(cusip) and am trying to write a query to select the top 4 records for each different cusip.. this is what i have so far and it gives back all ten records for each cusip.... is it possible to add a "top4" and distinct somewhere to fix my problem

existing query:
SELECT tblSecHoldings.Cusip, tblSecHoldings.DecDate, tblSecHoldings.ExDate, tblSecHoldings.RecDate, tblSecHoldings.PayDate, tblSecHoldings.Rate, tblSecHoldings.Freq, tblSecHoldings.CorpType
FROM tblSecHoldings
WHERE (((tblSecHoldings.CorpType)="regular cash"));
 
View the query in Design View.

On the bar, there will be a drop-down that should have "All" in it. You can change this to any number you want to determine how many values you want the query to show.

HTH Roy McCafferty
aka BanditWk

Las Vegas, NV
roy@cccamerica.org
RLMBandit@aol.com (private)

"No need to send gifts, just send a smile."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top