Results 1 to 7 of 7
  1. #1
    fluffyvampirekitten is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    108

    Find Duplicate query - help

    I want to filter all the duplicate Name , dob , gender and postal code but view all the fields


    AND filter by c_source = "SAP"

    Here is the code :

    Code:
    SELECT *
    FROM CrossSystemData
    WHERE (((CrossSystemData.NAME) In (SELECT [NAME] FROM [CrossSystemData] As Tmp GROUP BY [NAME],[DOB],[GENDER],[POSTAL_CODE] HAVING Count(*)>1  And [DOB] = [CrossSystemData].[DOB] And [GENDER] = [CrossSystemData].[GENDER] And [POSTAL_CODE] = [CrossSystemData].[POSTAL_CODE])))
    ORDER BY CrossSystemData.NAME, CrossSystemData.DOB, CrossSystemData.GENDER, CrossSystemData.POSTAL_CODE;
    Any idea on how to do this?
    Thanks in advance

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    Did you use the query wizard to create a Find Duplicate query with it?

  3. #3
    LaughingBull is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143
    on the properties of the query select yes by duplicate Values and it will filter duplicates

  4. #4
    fluffyvampirekitten is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    108
    Quote Originally Posted by ranman256 View Post
    Did you use the query wizard to create a Find Duplicate query with it?
    Yes , I used query wizard .

  5. #5
    fluffyvampirekitten is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    108
    Quote Originally Posted by LaughingBull View Post
    on the properties of the query select yes by duplicate Values and it will filter duplicates
    Select what Yes ? in the query properties ?

  6. #6
    LaughingBull is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Toledo Ohio
    Posts
    143
    Yes Click image for larger version. 

Name:	propertys.jpg 
Views:	17 
Size:	85.4 KB 
ID:	22042 hope this helps

  7. #7
    fluffyvampirekitten is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    108
    Quote Originally Posted by LaughingBull View Post
    Yes hope this helps

    Thanks for the help , however it doesn't filter out the unique values .

    here is the sql statement that was generated .
    Is there anything wrong with it ?

    Code:
    SELECT DISTINCT *
    FROM CrossSystemData
    WHERE (((CrossSystemData.[NAME]) In (SELECT [NAME] FROM [CrossSystemData] As Tmp GROUP BY [NAME],[DOB],[GENDER],[POSTAL_CODE] HAVING Count(*)>1  And [DOB] = [CrossSystemData].[DOB] And [GENDER] = [CrossSystemData].[GENDER] And [POSTAL_CODE] = [CrossSystemData].[POSTAL_CODE]))) 
    AND ((CrossSystemData.[C_SOURCE]) = ("SAP"))
    ORDER BY CrossSystemData.[NAME], CrossSystemData.[DOB], CrossSystemData.[GENDER], CrossSystemData.[POSTAL_CODE];

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

Similar Threads

  1. DCOUNT Find Duplicate values
    By whojstall11 in forum Programming
    Replies: 4
    Last Post: 04-04-2014, 02:00 PM
  2. Replies: 1
    Last Post: 12-20-2013, 05:14 PM
  3. Replies: 1
    Last Post: 02-18-2013, 02:11 PM
  4. Replies: 1
    Last Post: 04-30-2012, 08:42 AM
  5. Customer Entry/Find Duplicate/Similar names
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-27-2010, 09:20 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