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) »
  • OR query in Search Builder not functioning properly on this query
Pages: [1]

Author Topic: OR query in Search Builder not functioning properly on this query  (Read 757 times)

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
OR query in Search Builder not functioning properly on this query
November 03, 2008, 12:29:55 pm
So was trying to find all people with mobile numbers, including odd ones where they have been put in Phone field. 02 is our mobile prefix. so step 1 find those beginning with 02 or just 2
--------
Found 1628 contacts
    * Phone LIKE 02%   ... AND ... Contact Type - 'Individual'
    * OR
    * Phone LIKE 2%   ... AND ... Contact Type - 'Individual'
-----
so far so good. then add any that maybe in Phone field (which I know happens)

Then I tried to include a search just for Mobile numbers in Home phone fields - and the OR query seems to fail since it drops from found=1628 to found=1. I can easily do a work around. Just wondering how the OR query gets overridden somehow.

So really reporting this in case it points at some deeper problem - or is it just that the system can't deliver both Primary and non-primary phone numbers - certainly the latter is a problem I think we have hit in the past doing exports

------------
Found 1 contact

    * Phone LIKE 02%   ... AND ... Contact Type - 'Individual'
    * OR
    * Phone LIKE 2%   ... AND ... Contact Type - 'Individual'
    * OR
    * Phone (Home) LIKE '02%'   ... AND ... Contact Type - 'Individual'
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

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: OR query in Search Builder not functioning properly on this query
November 03, 2008, 04:33:38 pm

can you get chris to check the mysql log and see the difference between the two queries (and potentially paste it here). this might help isolate what is happening and why

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • OR query in Search Builder not functioning properly on this query

This forum was archived on 2017-11-26.