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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to search based on "how long this Contact has been in our Database"?
Pages: [1]

Author Topic: How to search based on "how long this Contact has been in our Database"?  (Read 772 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
How to search based on "how long this Contact has been in our Database"?
June 09, 2010, 09:57:27 pm
I have an interesting question I've not gotten before.  Someone has asked me to provide a way to answer this goal.

"We want to know everyone who has existed in our CiviCRM database for more than 2 years who has never made a Contribution."

NOTE: This is very different than asking "Who has never made a contribution?"

I looked at the schema in the db, and there is no, for lack of a better term, "Contact created on" date in the civicrm_contact table.  Is there such a date, to answer the question, "When was a contact created?"

Ideas? Am I missing something simple here?


Try CiviTeacher: the online video tutorial CiviCRM learning library.

demeritcowboy

  • Ask me questions
  • ****
  • Posts: 570
  • Karma: 42
  • CiviCRM version: Always the latest!
  • CMS version: Drupal 6 mostly, still evaluating 7.
  • MySQL version: Mix of 5.0 / 5.1 / 5.5
  • PHP version: 5.3, usually on Windows
Re: How to search based on "how long this Contact has been in our Database"?
June 09, 2010, 10:39:56 pm
It's in civicrm_log.

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: How to search based on "how long this Contact has been in our Database"?
June 10, 2010, 11:06:22 am
Got that. 

But I'm not seeing any way the change_log data is exposed to a search form like Advanced Search or Search Builder.  My guess is I'd have to write a custom query and custom search to gather the oldest change_log date for a particular contact, would I?

Or am I missing a search feature or report that already exists?

Try CiviTeacher: the online video tutorial CiviCRM learning library.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: How to search based on "how long this Contact has been in our Database"?
June 10, 2010, 12:11:26 pm
There's a custom search in the code distro called "Contacts by Date Added" that does that part for you. You'll need to modify / build on it to add the "never made a contribution" piece (or do an export and then compare to an export of everyone who's made some contribution - which you can do from Adv Search).
Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: How to search based on "how long this Contact has been in our Database"?
June 10, 2010, 01:16:29 pm
excellent.  this helps thanks.  by using this search and combining the results with another smart group that excludes donors, I should achieve my goals
« Last Edit: June 10, 2010, 01:18:09 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to search based on "how long this Contact has been in our Database"?

This forum was archived on 2017-11-26.