Results 1 to 2 of 2
  1. #1
    bigchicagobob is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    18

    Table with duplicate values

    I have a table, named "Pancakes" with about 15,000 rows.
    Within the table Pancakes there are the columns: [syrup], [diameter], [kitchen], [chef], and order amount.

    Problem: Partially duplicate rows.
    I can identify the partially duplicate rows by the [chef] value, [order amount] value, and [kitchen] value.

    All the partially duplicate rows have a [chef] = "05" but so do some of the non duplicate rows, which also have various numbers.
    All the partially duplicate rows have an [order amount] ="0" but so do some of the non duplicate rows, which also have various numbers.



    I can manually ID the duplicate rows by counting which [kitchen] values are greater or equal to 2. Then finding which rows have a [chef] = 05 and an [order amount] = 0.

    How would I go about writing a query to find and delelte the partially duplicate rows or automatically filtering the table data?

    Could I write a SQL query to find all the values where If(kitchen[Chef]=05 AND [order amout]=0

    Code:
    SELECT *
    FROM Pancakes
    WHERE Pancakes.[Chef]=05 AND Pancakes.[Order Amount]=0 AND (Select * FROM Pancakes WHERE HAVING Pancakes.Kitchen >=2;

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Try:

    Build an aggregate query

    SELECT Chef, [Order Amount], Count(Kitchen) AS CountKitchen FROM Pancakes ORDER BY Chef, [Order Amount];

    Build another query that joins first query to Pancakes table by linking on Chef and [Order Amount] fields. Apply criteria to CountKitchen field >=2.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-29-2013, 03:38 PM
  2. Finding Duplicate Values
    By TimMoffy in forum Forms
    Replies: 4
    Last Post: 11-21-2012, 10:22 PM
  3. Move duplicate values in a different table....
    By jhargram in forum Queries
    Replies: 1
    Last Post: 07-23-2012, 02:06 AM
  4. duplicate values
    By tarhim47 in forum Access
    Replies: 7
    Last Post: 05-03-2011, 11:30 AM
  5. Duplicate Values in table
    By senthilrg in forum Queries
    Replies: 3
    Last Post: 12-18-2009, 09:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums