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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query question??

Status
Not open for further replies.

ddbrook

Programmer
Aug 19, 2002
17
US
I have a query that retrieves multiple records in my active accounts but I only want to show the user just 3 records of each active account. Some accounts have about 20 or more if it is apts.

Example of data:

name,cust#,account#
BANY LANDING APTS ,1269,4945800
BANY LANDING APTS ,1269,4945820
BANY LANDING APTS ,1269,4945890
BANY LANDING APTS ,1269,4945940
BANY LANDING APTS ,1269,4946090
BANY LANDING APTS ,1269,4946100

Thanks for your help!

ddbrook

 
Create a 2nd query based on what you already have and preface the SQL statement with the TOP predicate as in:

SELECT TOP 3 .........

Cheers, Bill
 
I guess I didn't make myself clear...sorry.

I have multiple customers and these accounts with multiple records can be in the middle of my query so TOP 3 is not going to work.

I need all customer accounts but only 3 of each one.

Thanks and hopefully you can shine some light now.

ddbrook


 
What's the SQ?
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top