Results 1 to 4 of 4

Thread: Help With Query

  1. #1
    Join Date
    Jan 2003
    Location
    Ohio
    Posts
    3

    Angry Unanswered: 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

  2. #2
    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

  3. #3
    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

  4. #4
    Join Date
    Jan 2003
    Posts
    46
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •