Results 1 to 2 of 2
  1. #1
    Nik is offline Novice
    Windows 7 Access 2007
    Join Date
    Aug 2010
    Posts
    1

    Extracting Unique/Duplicate list with count in access

    Hi All,



    I am facing a problem in running this query. I have around 90000 records in a table in access from which i want to extract only unique entry with their total counts. There are multiple row heading like name, presentaddress, fathername, form no, type etc. Basically criteria for finding duplicate is based on 3 fields out of all these which are name, address, fathername. I am running this query but getting error. If i delete the additional fields other than used for criteria from select statement, then its running fine but i need to display other fields also thats why included them but getting an error

    SELECT [Bulk New].NAME, [Bulk New].FATHERNAME, [Bulk New].Presentaddress,[Bulk New].formno,[Bulk New].type, Count(*) AS [Count]
    FROM [Bulk New]
    GROUP BY [Bulk New].NAME, [Bulk New].FATHERNAME, [Bulk New].Presentaddress
    HAVING (((Count(*))>1));

    getting an error message " You tried to execute a query that does not include specified expression "Mobile number" as part of an agregate function.

    Request anybody to pls tell the workaround for this.

    Rgds
    Nik

  2. #2
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi,

    when creating a groups query, all fields in it have to make part of the grouping clause or have an aggregate function. So, if you can't include them in the grouping statement you could use a MIN or MAX function with the field name.

    greetings
    NG

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

Similar Threads

  1. Extracting text from XML data
    By rob4465 in forum Access
    Replies: 1
    Last Post: 03-18-2010, 06:41 PM
  2. Count of Unique Values
    By vsmk in forum Queries
    Replies: 2
    Last Post: 03-14-2010, 12:07 AM
  3. Extracting data after a keyword
    By KerryA in forum Queries
    Replies: 1
    Last Post: 02-11-2010, 09:56 PM
  4. Need Duplicate List Box
    By newbie in forum Forms
    Replies: 7
    Last Post: 05-11-2009, 09:45 AM
  5. Extracting Database Schema From Access
    By ChloeRadshaw in forum Access
    Replies: 0
    Last Post: 01-29-2009, 04:49 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