Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Help to understand a qry (Access 2002)

    Hi

    Could someone help with an explanation of what is happening here please.


    In (SELECT [KeyAcct3] FROM [Non99Customers] As Tmp GROUP BY [KeyAcct3],[PostCode] HAVING Count(*)>1 And [PostCode] = [Non99Customers].[PostCode])

    Many Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Help to understand a qry (Access 2002)

    This is the criteria part for a Find Duplicates query. It says that the query should return all records for which the KeyAcct3 field is in the subquery

    SELECT [KeyAcct3] FROM [Non99Customers] As Tmp GROUP BY [KeyAcct3],[PostCode] HAVING Count(*)>1 And [PostCode] = [Non99Customers].[PostCode]

    This subquery takes the table (or query) Non99Customers, and groups the records by KeyAcct3 and PostCode, where PostCode is the same as the value in the main table/query. Only KeyAcct3 values occurring more than once are included. i.e. duplicates.

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Help to understand a qry (Access 2002)

    Hi

    Many thanks for the explanation it is very helpful.

    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •