Answers.Body: <p>We found a solution by using this SQL query:</p>
  
  <pre><code>/* === Duplicate contributions === */
  /* c contact * b contribution * t temporary */
  SELECT b.contact_id ContactID, c.last_name Last name, c.first_name First name,
         b.source Year, b.total_amount Contribution,
         b.receive_date Received,  b.receipt_date Processed
  FROM civicrm_contribution b
  JOIN (
      select b.contact_id, b.source, count(*)
      from civicrm_contribution b
      group by b.contact_id, b.source
      having count(*) &gt; 1
      )
      t on b.contact_id = t.contact_id and b.source = t.source
  INNER JOIN civicrm_contact c ON b.contact_id=c.id
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T07:39:17.193Z
Answers.Text: The caveat is that this will only work if your contacts only make one contribution per year.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T11:57:16.370Z
Answers.Text: @JonG-MegaphoneTech. This is indeed the case, one yearly contribution for yearly membership.
Answers.UserDisplayName: MarkDQ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T00:18:03.417Z
Answers.LastActivityDate: 2017-11-07T00:18:03.417Z
Answers.UserDisplayName: MarkDQ
Body: <p>We detected recently some duplicate contributions records. How to make a list of all duplicates? We use the field "source" to indicate the year of the contribution. So we are looking of a list of duplicate contributions for instance for source = "2017"</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-06T19:04:59.730Z
Comments.Text: Could you clarify what's meant by "duplicate"?  Is this an online donation that got recorded twice due to a bug?  Is it someone doing data entry by hand that entered a batch of donations twice?  Donations that were imported twice?  Each one would have a different strategy in my opinion.
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-07T00:03:51.213Z
Comments.Text: @JonG-MegaphoneTech. All contributions are manually updated by a volunteer, based on bank payments.
Comments.UserDisplayName: MarkDQ
Tags: <civicontribute>
Title: Search for duplicate contributions
ThreadText: # Search for duplicate contributions
  
  (Asked by: username_0 on 2017-11-06)
  
  We detected recently some duplicate contributions records. How to make a list of all duplicates? We use the field "source" to indicate the year of the contribution. So we are looking of a list of duplicate contributions for instance for source = "2017"
  
  **Tags:** civicontribute
  
  > **Comments:**
  > **username_1**: Could you clarify what's meant by "duplicate"?  Is this an online donation that got recorded twice due to a bug?  Is it someone doing data entry by hand that entered a batch of donations twice?  Donations that were imported twice?  Each one would have a different strategy in my opinion.  
  > **username_0**: @username_1. All contributions are manually updated by a volunteer, based on bank payments.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-11-07. Score: 1
  
  We found a solution by using this SQL query:
  
  ```
  /* === Duplicate contributions === */
  /* c contact * b contribution * t temporary */
  SELECT b.contact_id ContactID, c.last_name Last name, c.first_name First name,
         b.source Year, b.total_amount Contribution,
         b.receive_date Received,  b.receipt_date Processed
  FROM civicrm_contribution b
  JOIN (
      select b.contact_id, b.source, count(*)
      from civicrm_contribution b
      group by b.contact_id, b.source
      having count(*) > 1
      )
      t on b.contact_id = t.contact_id and b.source = t.source
  INNER JOIN civicrm_contact c ON b.contact_id=c.id
  
  ```
  
  > **Comments:**
  > **username_1**: The caveat is that this will only work if your contacts only make one contribution per year.  
  > **username_0**: @username_1. This is indeed the case, one yearly contribution for yearly membership.  
  
  ---
  
  