Help

shaz123

Registered User.
Local time
Today, 12:24
Joined
Sep 8, 2006
Messages
81
I have a query but i do not wish to see any repeating results, for example there cannot be a result with the same works order number and product number. for instance

Product number Works order number
22180 565656
22180 565656

So u cannot have two of the same products in one works order, how do u prevent the query from showing such duplicates, as it is currently doing.
Keeping in mind that there can be the same product number in a number of different work orders number.
For instance u can have the following:

product number Works order number
22180 454545
22180 454808


If i grouped by "where' wihin te query for both fields would this work.

Q2- If i run the query again, i do not want to add the existing results within the table again, as the will result in having duplicate entries. How can i stop this.
 
in your query property set "unique values" in the result. this will eliminate the duplicates.
 
shaz123,

Just out of curiosity, is this query formed by joining two or more tables together? Improper joins can often lead to unwanted duplicate records depending on how the join is made. There are a number of ways to eliminate duplicates. The most important being ensuring proper joins between tables or queries. The second could be using aggregate queries to group identical records and the third as gemma-the-husky has said would be to use the "unique values only" selection...which is my least favorite as it tends to hide problems.
 
Hi ST4RCUUTER,
The query is based upon a makeup query, the makeup table is based upon linked to tables.

I have created and append query to extract information form the specgas Makeup query results.

what im trying to di is when the append query is clicked on the secind time do not want the reuslt to be repeated again
 
if i set the works order number, productname and line number as primary keys, would this prevent an order being added with the same line number/product number/works order number
 
if you know the data is genuine, and your queries are retrieving multiple lines, then setting the query properties to unique values will get rid of the duplicates.

I think that's what you are saying

Sometimes you find that a "unique values" query may not be updateable though.

------------------------------------------------
The other point is that if you are inserting records into a table you can possibly take advantage of a non-duplicating key. Merely suppress error messages, and the query or sql statement will only insert one record for each of the duplicated values.
 

Users who are viewing this thread

Back
Top Bottom