Results 1 to 4 of 4
  1. #1
    Benj is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    33

    error message on find duplicate query

    I have this error "Your query does not include the specific expression (blah blah blah) as part of an aggregate function" when i did a FIND DUPLICATE QUERY. here it is

    SELECT tblpiglet.SowIds, tblpiglet.PigletDate, tblpiglet.PigNum, tblpiglet.Reason, [SowIds] & [PigletDate] & IIf(IsNull([Reason]),IIf([PigNum]>0,"P","N"),[Reason]) AS Filtering FROM tblpiglet WHERE ((([SowIds] & [PigletDate] & IIf(IsNull([Reason]),IIf([PigNum]>0,"P","N"),[Reason])) In (SELECT [Filtering] FROM [qryDupSource] As Tmp GROUP BY [Filtering] HAVING Count(*)>1 ))) ORDER BY tblpiglet.SowIds, tblpiglet.PigletDate, [SowIds] & [PigletDate] & IIf(IsNull([Reason]),IIf([PigNum]>0,"P","N"),[Reason]);




    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
    Is this home made ,or made by query wizard.
    the wizard don't error.

    i would make a regular select query WITH your IIF.
    THEN make the dupe query on that.

  3. #3
    Benj is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    May 2018
    Posts
    33
    what i did was make a regular query
    SELECT tblpiglet.SowIds, tblpiglet.PigletDate, tblpiglet.PigNum, tblpiglet.Reason, [SowIds] & [PigletDate] & IIf(IsNull([Reason]),IIf([PigNum]>0,"P","N"),[Reason]) AS Filtering FROM tblpiglet ORDER BY tblpiglet.SowIds, tblpiglet.PigletDate, [SowIds] & [PigletDate] & IIf(IsNull([Reason]),IIf([PigNum]>0,"P","N"),[Reason]);


    then used this query for the wizard duplicate, it gave me that error. so i just copied the criteria from the duplicate query and paste it on my first query, still the same error

    thanks ranman256

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    no, you dont copy the criteria, Query 1 has the criteria.
    then the Find duplicate query uses Q1.
    zero criteria in FDQ.

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

Similar Threads

  1. Replies: 4
    Last Post: 04-26-2018, 01:23 PM
  2. Replies: 4
    Last Post: 01-14-2016, 02:18 PM
  3. Duplicate Record Error Message!!
    By forumer in forum Forms
    Replies: 6
    Last Post: 03-14-2014, 07:25 AM
  4. Customise the duplicate values error message
    By lsmcal1984 in forum Forms
    Replies: 2
    Last Post: 10-09-2013, 04:36 PM
  5. Replies: 1
    Last Post: 02-18-2013, 02:11 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