CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Finding old/stale contacts
Pages: [1]

Author Topic: Finding old/stale contacts  (Read 850 times)

matth

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Finding old/stale contacts
June 28, 2011, 01:25:02 pm
I'd looking to generate a report on contacts that haven't been edited in a given timeframe. For example, we might want find all the contacts who haven't been edited in the last six months.

If this isn't something that already exists, I'd love any suggestions on how to structure the report queries. I've got a couple hack-ish thoughts about how to do this using the activity log, but it would be helpful to hear from the experts.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Finding old/stale contacts
June 28, 2011, 02:16:22 pm
Hi,

Sounds useful and doesn't exist yet to my knowledge.

Why are you calling it hackish to use civicrm_log?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

matth

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 3.4
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Finding old/stale contacts
June 28, 2011, 02:27:21 pm
I did notice that the database doesn't keep a last edited date for each contact.

The brute-force methods I thought of would require touching a lot of contacts:

1. Find all contacts.
2. For each contact, if there is an edit after a given date in the log, remove from list

1. Get IDs of contacts updated in the last time period from the log.
2. Find all contacts not in that list.

Could attach a limit to the second to make it more reasonable -- we could then just refresh the report when we need more contacts to update.
« Last Edit: June 28, 2011, 02:30:25 pm by matth »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Finding old/stale contacts

This forum was archived on 2017-11-26.