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) »
  • Searching for blank fields
Pages: [1]

Author Topic: Searching for blank fields  (Read 1183 times)

jystewart

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
Searching for blank fields
November 08, 2007, 08:05:59 am
My client is very keen to be able to search for fields with empty values, in particular they want to be able to find any records where both email and postal code are blank.

I'm aware that the SQL for doing this across joins is not trivial, and have spotted:

http://issues.civicrm.org/jira/browse/CRM-816

and

http://forum.civicrm.org/index.php/topic,297.0.html

but am wondering if anyone has developed a patch/hack or workaround for the 1.8 or 1.9 releases that would enable these searches?

If not, I'll probably have to dive in and write some SQL to do these searches. Is there any documentation on adding custom search types to CiviCRM?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Searching for blank fields
November 08, 2007, 09:36:02 am

The below would be fairly easy in 2.0 with its custom search capability as described at http://civicrm.org/node/254

In 1.9 and below you might want to experiment with the method chris describes here.

http://forum.civicrm.org/index.php/topic,1510.msg6548.html#msg6548

I suspect it might work for you also :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Searching for blank fields
November 08, 2007, 09:38:41 am
We're developing a framework for implementing custom searches which will allow developers to define criteria, query and results columns - for 2.0: http://issues.civicrm.org/jira/browse/CRM-2360

Until then, you might be able to use the technique for modifying a Smart Group's saved search query as described here:
http://forum.civicrm.org/index.php/topic,1510.0.html

.... or look at developing a report for this via BIRT ("CiviReport") - using the distributed and contributed samples as a starting point.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Searching for blank fields

This forum was archived on 2017-11-26.