• 97 – Query Returns Duplicates

    • This topic has 2 replies, 2 voices, and was last updated 24 years ago.
    Author
    Topic
    #354767

    I have a parameter query to pull records for user selected dates (i.e., beginning date and ending date). When I run it, it returns multiple records. For instance, it will return 174 records, but when I click on sort by date, it shows 6 records (the right number). The 174 seems to be many many duplicates. What am I doing wrong?

    Viewing 0 reply threads
    Author
    Replies
    • #521916

      Well, I found the answer. I had copied the query from another query and deleted the fields I didn’t want. However, that left a table in the query that I wasn’t using. When I deleted that table from the query (even though I wasn’t using any of the fields from that table), it worked beautifully. I don’t know SQL, but when I looked at it in SQL view, there was an innerjoin. Whew.

      • #521944

        You should always remove unused tables from queries. The joins with such a table can easily create multiple instances of a record unless the relationship between that table and the one it’s joined to is one-to-one.

    Viewing 0 reply threads
    Reply To: 97 – Query Returns Duplicates

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: