If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Help With Query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-31-03, 12:12
lost1 lost1 is offline
Registered User
 
Join Date: Jan 2003
Location: Ohio
Posts: 3
Angry Help With Query

I have a question concerning a queries. I have a query that looks through a couple of tables and returns about 9,000 rows. This query has 5 columns. The problem is that each field in the row may have the same information as the previous row. I want to be able to lesson the return of this query to about 10 rows. Atleast that is my goal! I want to be able to compare the previous row of that query to the current row of that same query. But, I am unsure what the best way to do that. Could someone provide me with a little direction.

Thanks
Larry
Reply With Quote
  #2 (permalink)  
Old 01-31-03, 13:53
zambezibill zambezibill is offline
Registered User
 
Join Date: Jan 2003
Posts: 46
YOu may have some table normalization issues to review and resolve, but for a short and quick possible solution try setting the query's Unique Values property to Yes.

This will return unique rows based on the fields included within the query.

Cheers, Bill
Reply With Quote
  #3 (permalink)  
Old 01-31-03, 14:38
lost1 lost1 is offline
Registered User
 
Join Date: Jan 2003
Location: Ohio
Posts: 3
Well, That would work as a distinct row but access seems like it take a sum of all fields to test if the row is distict. Getting closer though. That would take the 9,000 record query and drop it to about 90!.

Any other thoughts
Thanks
Larry
Reply With Quote
  #4 (permalink)  
Old 01-31-03, 18:45
zambezibill zambezibill is offline
Registered User
 
Join Date: Jan 2003
Posts: 46
Quote:
Originally posted by lost1
Well, That would work as a distinct row but access seems like it take a sum of all fields to test if the row is distict. Getting closer though. That would take the 9,000 record query and drop it to about 90!.

Any other thoughts
Thanks
Larry
Try setting the query's unique records property to yes. This will possibly further restrict your recordset as it will look for unique records from the underlying tables.

But if you are simply looking to return an arbitrary 10 records, then try the TOP qualifier (as in SELECT TOP 10 for the beginning of the SQL statement).

Cheers, Bill
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On