Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-607

Export Problems from Advanced Search - Searchable Numeric Flds Throw SQL Error & Not all Rows Exported

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3
    • Component/s: None
    • Labels:
      None

      Description

      1. Exporting Advanced Search Result set results in mal-formed SQL/error IF there is a searchable numeric custom data field exists in the domain (data types = money, int, numeric). To recreate:

      • Load the standard sample data (generated.mysql) - this includes Voter Info-Precinct which is a searchable Integer custom field
      • Go to Advanced Search, and click Newsletter Subscribers group + Major Donor tag. Search will return 7 records.
      • Select 'all records' radio and Export Contacts task - click Go
      • Select 'Primary Contact info' radio and click Continue

      You will get a fatal DB syntax error. The issue that I see in the query is that the WHERE clause includes the numeric (in this case INT) data column with and equal operator but nothing on the right side: e.g. WHERE ....custom_value_4.int_data = AND We probably need to eliminate this clause from the filter if that field is not populated on the search form. Or set the operation to IS NULL ??

      2. Export from Advanced Search is not returning all selected records. To recreate:

      • Update your custom data so that Voter Info - Precinct is NOT SEARCHABLE (this will allow you to actually export data w/o error)
      • Repeat the same Advanced Search as above.
        The export file only has 2 records - despite the fact that the Export task page (and qill) shows 7 records in result set.

      ---- original post from Jack Aponte (covered in above general description) ------------
      When a CiviCRM installation includes a money custom field, attempted exports of the results from advanced searches cause MySQL errors. This error occurs as long as the money custom fields are searchable; when they are changed to not be searchable, there are no longer errors. This also happens regardless of whether the custom field was actually included in the advanced search from which the export is being conducted.

      Here is an example of such an error. The problem is with this specific part:

      LEFT JOIN civicrm_custom_value custom_value_21 ON custom_value_21.custom_field_id = 21 AND custom_value_21.entity_table = 'civicrm_contact' AND custom_value_21.entity_id = civicrm_contact.id LEFT JOIN civicrm_group_contact ON civicrm_contact.id = civicrm_group_contact.contact_id WHERE civicrm_contact.domain_id = 1 AND civicrm_contact.contact_type IN ('Organization') AND civicrm_group_contact.group_id IN (7) AND civicrm_group_contact.status IN ("Added") AND custom_value_5.memo_data LIKE '%%' AND LOWER(custom_value_15.char_data) LIKE '%%' AND custom_value_10.decimal_data = [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 18]

      Below is the entire error.

      Sorry. A non-recoverable error has occurred. Database Error Code: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 18, 1064
      Array
      (
      [callback] => Array
      (
      [0] => CRM_Core_Error
      [1] => handle
      )

      [code] => -2
      [message] => DB Error: syntax error
      [mode] => 16
      [debug_info] => SELECT DISTINCT civicrm_contact.id as contact_id, civicrm_individual.id as individual_id, civicrm_individual.first_name as first_name, civicrm_individual.middle_name as middle_name, civicrm_individual.last_name as last_name, civicrm_individual.job_title as job_title, civicrm_individual.birth_date as birth_date, civicrm_gender.id as gender_id, civicrm_gender.name as gender, civicrm_individual_prefix.id as individual_prefix_id, civicrm_individual_prefix.name as individual_prefix, civicrm_individual_suffix.id as individual_suffix_id, civicrm_individual_suffix.name as individual_suffix, civicrm_household.id as household_id, civicrm_household.household_name as household_name, civicrm_organization.id as organization_id, civicrm_organization.organization_name as organization_name, civicrm_organization.legal_name as legal_name, civicrm_organization.sic_code as sic_code, civicrm_location.id as location_id, civicrm_address.id as address_id, civicrm_address.street_address as street_address, civicrm_address.supplemental_address_1 as supplemental_address_1, civicrm_address.supplemental_address_2 as supplemental_address_2, civicrm_address.city as city, civicrm_address.postal_code as postal_code, civicrm_state_province.id as state_province_id, civicrm_state_province.name as state_province, civicrm_country.id as country_id, civicrm_country.name as country, civicrm_phone.id as phone_id, civicrm_phone.phone as phone, civicrm_email.id as email_id, civicrm_email.email as email, civicrm_im.id as im_id, civicrm_im.name as im, civicrm_contact.legal_identifier as legal_identifier, civicrm_contact.external_identifier as external_identifier, civicrm_contact.nick_name as nick_name, civicrm_contact.home_URL as home_URL, civicrm_note.id as note_id, civicrm_note.note as note, custom_value_2.id as custom_value_2_id, custom_value_2.char_data as custom_2, custom_value_4.id as custom_value_4_id, custom_value_4.char_data as custom_4, custom_value_5.id as custom_value_5_id, custom_value_5.memo_data as custom_5, custom_value_6.id as custom_value_6_id, custom_value_6.int_data as custom_6, custom_value_7.id as custom_value_7_id, custom_value_7.int_data as custom_7, custom_value_9.id as custom_value_9_id, custom_value_9.date_data as custom_9, custom_value_10.id as custom_value_10_id, custom_value_10.decimal_data as custom_10, custom_value_11.id as custom_value_11_id, custom_value_11.date_data as custom_11, custom_value_20.id as custom_value_20_id, custom_value_20.char_data as custom_20, custom_value_13.id as custom_value_13_id, custom_value_13.char_data as custom_13, custom_value_14.id as custom_value_14_id, custom_value_14.char_data as custom_14, custom_value_15.id as custom_value_15_id, custom_value_15.char_data as custom_15, custom_value_16.id as custom_value_16_id, custom_value_16.int_data as custom_16, custom_value_19.id as custom_value_19_id, custom_value_19.decimal_data as custom_19, custom_value_21.id as custom_value_21_id, custom_value_21.char_data as custom_21, civicrm_group_contact.id as group_contact_id, civicrm_group_contact.status as status FROM civicrm_contact LEFT JOIN civicrm_individual ON (civicrm_contact.id = civicrm_individual.contact_id) LEFT JOIN civicrm_gender ON civicrm_individual.gender_id = civicrm_gender.id LEFT JOIN civicrm_individual_prefix ON civicrm_individual.prefix_id = civicrm_individual_prefix.id LEFT JOIN civicrm_individual_suffix ON civicrm_individual.suffix_id = civicrm_individual_suffix.id LEFT JOIN civicrm_household ON (civicrm_contact.id = civicrm_household.contact_id) LEFT JOIN civicrm_organization ON (civicrm_contact.id = civicrm_organization.contact_id) LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_contact' AND
      civicrm_contact.id = civicrm_location.entity_id AND civicrm_location.is_primary = 1) LEFT JOIN civicrm_address ON civicrm_location.id = civicrm_address.location_id LEFT JOIN civicrm_state_province ON civicrm_address.state_province_id = civicrm_state_province.id LEFT JOIN civicrm_country ON civicrm_address.country_id = civicrm_country.id LEFT JOIN civicrm_phone ON (civicrm_location.id = civicrm_phone.location_id AND civicrm_phone.is_primary = 1) LEFT JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1) LEFT JOIN civicrm_im ON (civicrm_location.id = civicrm_im.location_id AND civicrm_im.is_primary = 1) LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
      civicrm_contact.id = civicrm_note.entity_id )
      LEFT JOIN civicrm_custom_value custom_value_2 ON custom_value_2.custom_field_id = 2 AND custom_value_2.entity_table = 'civicrm_contact' AND custom_value_2.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_4 ON custom_value_4.custom_field_id = 4 AND custom_value_4.entity_table = 'civicrm_contact' AND custom_value_4.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_5 ON custom_value_5.custom_field_id = 5 AND custom_value_5.entity_table = 'civicrm_contact' AND custom_value_5.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_6 ON custom_value_6.custom_field_id = 6 AND custom_value_6.entity_table = 'civicrm_contact' AND custom_value_6.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_7 ON custom_value_7.custom_field_id = 7 AND custom_value_7.entity_table = 'civicrm_contact' AND custom_value_7.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_9 ON custom_value_9.custom_field_id = 9 AND custom_value_9.entity_table = 'civicrm_contact' AND custom_value_9.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_10 ON custom_value_10.custom_field_id = 10 AND custom_value_10.entity_table = 'civicrm_contact' AND custom_value_10.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_11 ON custom_value_11.custom_field_id = 11 AND custom_value_11.entity_table = 'civicrm_contact' AND custom_value_11.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_20 ON custom_value_20.custom_field_id = 20 AND custom_value_20.entity_table = 'civicrm_contact' AND custom_value_20.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_13 ON custom_value_13.custom_field_id = 13 AND custom_value_13.entity_table = 'civicrm_contact' AND custom_value_13.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_14 ON custom_value_14.custom_field_id = 14 AND custom_value_14.entity_table = 'civicrm_contact' AND custom_value_14.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_15 ON custom_value_15.custom_field_id = 15 AND custom_value_15.entity_table = 'civicrm_contact' AND custom_value_15.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_16 ON custom_value_16.custom_field_id = 16 AND custom_value_16.entity_table = 'civicrm_contact' AND custom_value_16.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_19 ON custom_value_19.custom_field_id = 19 AND custom_value_19.entity_table = 'civicrm_contact' AND custom_value_19.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_21 ON custom_value_21.custom_field_id = 21 AND custom_value_21.entity_table = 'civicrm_contact' AND custom_value_21.entity_id = civicrm_contact.id LEFT JOIN civicrm_group_contact ON civicrm_contact.id = civicrm_group_contact.contact_id WHERE civicrm_contact.domain_id = 1 AND civicrm_contact.contact_type IN ('Organization') AND civicrm_group_contact.group_id IN (7) AND civicrm_group_contact.status IN ("Added") AND custom_value_5.memo_data LIKE '%%' AND LOWER(custom_value_15.char_data) LIKE '%%' AND custom_value_10.decimal_data = [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 18]
      [type] => DB_Error
      [user_info] => SELECT DISTINCT civicrm_contact.id as contact_id, civicrm_individual.id as individual_id, civicrm_individual.first_name as first_name, civicrm_individual.middle_name as middle_name, civicrm_individual.last_name as last_name, civicrm_individual.job_title as job_title, civicrm_individual.birth_date as birth_date, civicrm_gender.id as gender_id, civicrm_gender.name as gender, civicrm_individual_prefix.id as individual_prefix_id, civicrm_individual_prefix.name as individual_prefix, civicrm_individual_suffix.id as individual_suffix_id, civicrm_individual_suffix.name as individual_suffix, civicrm_household.id as household_id, civicrm_household.household_name as household_name, civicrm_organization.id as organization_id, civicrm_organization.organization_name as organization_name, civicrm_organization.legal_name as legal_name, civicrm_organization.sic_code as sic_code, civicrm_location.id as location_id, civicrm_address.id as address_id, civicrm_address.street_address as street_address, civicrm_address.supplemental_address_1 as supplemental_address_1, civicrm_address.supplemental_address_2 as supplemental_address_2, civicrm_address.city as city, civicrm_address.postal_code as postal_code, civicrm_state_province.id as state_province_id, civicrm_state_province.name as state_province, civicrm_country.id as country_id, civicrm_country.name as country, civicrm_phone.id as phone_id, civicrm_phone.phone as phone, civicrm_email.id as email_id, civicrm_email.email as email, civicrm_im.id as im_id, civicrm_im.name as im, civicrm_contact.legal_identifier as legal_identifier, civicrm_contact.external_identifier as external_identifier, civicrm_contact.nick_name as nick_name, civicrm_contact.home_URL as home_URL, civicrm_note.id as note_id, civicrm_note.note as note, custom_value_2.id as custom_value_2_id, custom_value_2.char_data as custom_2, custom_value_4.id as custom_value_4_id, custom_value_4.char_data as custom_4, custom_value_5.id as custom_value_5_id, custom_value_5.memo_data as custom_5, custom_value_6.id as custom_value_6_id, custom_value_6.int_data as custom_6, custom_value_7.id as custom_value_7_id, custom_value_7.int_data as custom_7, custom_value_9.id as custom_value_9_id, custom_value_9.date_data as custom_9, custom_value_10.id as custom_value_10_id, custom_value_10.decimal_data as custom_10, custom_value_11.id as custom_value_11_id, custom_value_11.date_data as custom_11, custom_value_20.id as custom_value_20_id, custom_value_20.char_data as custom_20, custom_value_13.id as custom_value_13_id, custom_value_13.char_data as custom_13, custom_value_14.id as custom_value_14_id, custom_value_14.char_data as custom_14, custom_value_15.id as custom_value_15_id, custom_value_15.char_data as custom_15, custom_value_16.id as custom_value_16_id, custom_value_16.int_data as custom_16, custom_value_19.id as custom_value_19_id, custom_value_19.decimal_data as custom_19, custom_value_21.id as custom_value_21_id, custom_value_21.char_data as custom_21, civicrm_group_contact.id as group_contact_id, civicrm_group_contact.status as status FROM civicrm_contact LEFT JOIN civicrm_individual ON (civicrm_contact.id = civicrm_individual.contact_id) LEFT JOIN civicrm_gender ON civicrm_individual.gender_id = civicrm_gender.id LEFT JOIN civicrm_individual_prefix ON civicrm_individual.prefix_id = civicrm_individual_prefix.id LEFT JOIN civicrm_individual_suffix ON civicrm_individual.suffix_id = civicrm_individual_suffix.id LEFT JOIN civicrm_household ON (civicrm_contact.id = civicrm_household.contact_id) LEFT JOIN civicrm_organization ON (civicrm_contact.id = civicrm_organization.contact_id) LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_contact' AND
      civicrm_contact.id = civicrm_location.entity_id AND civicrm_location.is_primary = 1) LEFT JOIN civicrm_address ON civicrm_location.id = civicrm_address.location_id LEFT JOIN civicrm_state_province ON civicrm_address.state_province_id = civicrm_state_province.id LEFT JOIN civicrm_country ON civicrm_address.country_id = civicrm_country.id LEFT JOIN civicrm_phone ON (civicrm_location.id = civicrm_phone.location_id AND civicrm_phone.is_primary = 1) LEFT JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1) LEFT JOIN civicrm_im ON (civicrm_location.id = civicrm_im.location_id AND civicrm_im.is_primary = 1) LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
      civicrm_contact.id = civicrm_note.entity_id )
      LEFT JOIN civicrm_custom_value custom_value_2 ON custom_value_2.custom_field_id = 2 AND custom_value_2.entity_table = 'civicrm_contact' AND custom_value_2.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_4 ON custom_value_4.custom_field_id = 4 AND custom_value_4.entity_table = 'civicrm_contact' AND custom_value_4.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_5 ON custom_value_5.custom_field_id = 5 AND custom_value_5.entity_table = 'civicrm_contact' AND custom_value_5.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_6 ON custom_value_6.custom_field_id = 6 AND custom_value_6.entity_table = 'civicrm_contact' AND custom_value_6.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_7 ON custom_value_7.custom_field_id = 7 AND custom_value_7.entity_table = 'civicrm_contact' AND custom_value_7.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_9 ON custom_value_9.custom_field_id = 9 AND custom_value_9.entity_table = 'civicrm_contact' AND custom_value_9.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_10 ON custom_value_10.custom_field_id = 10 AND custom_value_10.entity_table = 'civicrm_contact' AND custom_value_10.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_11 ON custom_value_11.custom_field_id = 11 AND custom_value_11.entity_table = 'civicrm_contact' AND custom_value_11.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_20 ON custom_value_20.custom_field_id = 20 AND custom_value_20.entity_table = 'civicrm_contact' AND custom_value_20.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_13 ON custom_value_13.custom_field_id = 13 AND custom_value_13.entity_table = 'civicrm_contact' AND custom_value_13.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_14 ON custom_value_14.custom_field_id = 14 AND custom_value_14.entity_table = 'civicrm_contact' AND custom_value_14.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_15 ON custom_value_15.custom_field_id = 15 AND custom_value_15.entity_table = 'civicrm_contact' AND custom_value_15.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_16 ON custom_value_16.custom_field_id = 16 AND custom_value_16.entity_table = 'civicrm_contact' AND custom_value_16.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_19 ON custom_value_19.custom_field_id = 19 AND custom_value_19.entity_table = 'civicrm_contact' AND custom_value_19.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_21 ON custom_value_21.custom_field_id = 21 AND custom_value_21.entity_table = 'civicrm_contact' AND custom_value_21.entity_id = civicrm_contact.id LEFT JOIN civicrm_group_contact ON civicrm_contact.id = civicrm_group_contact.contact_id WHERE civicrm_contact.domain_id = 1 AND civicrm_contact.contact_type IN ('Organization') AND civicrm_group_contact.group_id IN (7) AND civicrm_group_contact.status IN ("Added") AND custom_value_5.memo_data LIKE '%%' AND LOWER(custom_value_15.char_data) LIKE '%%' AND custom_value_10.decimal_data = [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 18]
      [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT DISTINCT civicrm_contact.id as contact_id, civicrm_individual.id as individual_id, civicrm_individual.first_name as first_name, civicrm_individual.middle_name as middle_name, civicrm_individual.last_name as last_name, civicrm_individual.job_title as job_title, civicrm_individual.birth_date as birth_date, civicrm_gender.id as gender_id, civicrm_gender.name as gender, civicrm_individual_prefix.id as individual_prefix_id, civicrm_individual_prefix.name as individual_prefix, civicrm_individual_suffix.id as individual_suffix_id, civicrm_individual_suffix.name as individual_suffix, civicrm_household.id as household_id, civicrm_household.household_name as household_name, civicrm_organization.id as organization_id, civicrm_organization.organization_name as organization_name, civicrm_organization.legal_name as legal_name, civicrm_organization.sic_code as sic_code, civicrm_location.id as location_id, civicrm_address.id as address_id, civicrm_address.street_address as street_address, civicrm_address.supplemental_address_1 as supplemental_address_1, civicrm_address.supplemental_address_2 as supplemental_address_2, civicrm_address.city as city, civicrm_address.postal_code as postal_code, civicrm_state_province.id as state_province_id, civicrm_state_province.name as state_province, civicrm_country.id as country_id, civicrm_country.name as country, civicrm_phone.id as phone_id, civicrm_phone.phone as phone, civicrm_email.id as email_id, civicrm_email.email as email, civicrm_im.id as im_id, civicrm_im.name as im, civicrm_contact.legal_identifier as legal_identifier, civicrm_contact.external_identifier as external_identifier, civicrm_contact.nick_name as nick_name, civicrm_contact.home_URL as home_URL, civicrm_note.id as note_id, civicrm_note.note as note, custom_value_2.id as custom_value_2_id, custom_value_2.char_data as custom_2, custom_value_4.id as custom_value_4_id, custom_value_4.char_data as custom_4, custom_value_5.id as custom_value_5_id, custom_value_5.memo_data as custom_5, custom_value_6.id as custom_value_6_id, custom_value_6.int_data as custom_6, custom_value_7.id as custom_value_7_id, custom_value_7.int_data as custom_7, custom_value_9.id as custom_value_9_id, custom_value_9.date_data as custom_9, custom_value_10.id as custom_value_10_id, custom_value_10.decimal_data as custom_10, custom_value_11.id as custom_value_11_id, custom_value_11.date_data as custom_11, custom_value_20.id as custom_value_20_id, custom_value_20.char_data as custom_20, custom_value_13.id as custom_value_13_id, custom_value_13.char_data as custom_13, custom_value_14.id as custom_value_14_id, custom_value_14.char_data as custom_14, custom_value_15.id as custom_value_15_id, custom_value_15.char_data as custom_15, custom_value_16.id as custom_value_16_id, custom_value_16.int_data as custom_16, custom_value_19.id as custom_value_19_id, custom_value_19.decimal_data as custom_19, custom_value_21.id as custom_value_21_id, custom_value_21.char_data as custom_21, civicrm_group_contact.id as group_contact_id, civicrm_group_contact.status as status FROM civicrm_contact LEFT JOIN civicrm_individual ON (civicrm_contact.id = civicrm_individual.contact_id) LEFT JOIN civicrm_gender ON civicrm_individual.gender_id = civicrm_gender.id LEFT JOIN civicrm_individual_prefix ON civicrm_individual.prefix_id = civicrm_individual_prefix.id LEFT JOIN civicrm_individual_suffix ON civicrm_individual.suffix_id = civicrm_individual_suffix.id LEFT JOIN civicrm_household ON (civicrm_contact.id = civicrm_household.contact_id) LEFT JOIN civicrm_organization ON (civicrm_contact.id = civicrm_organization.contact_id) LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_contact' AND
      civicrm_contact.id = civicrm_location.entity_id AND civicrm_location.is_primary = 1) LEFT JOIN civicrm_address ON civicrm_location.id = civicrm_address.location_id LEFT JOIN civicrm_state_province ON civicrm_address.state_province_id = civicrm_state_province.id LEFT JOIN civicrm_country ON civicrm_address.country_id = civicrm_country.id LEFT JOIN civicrm_phone ON (civicrm_location.id = civicrm_phone.location_id AND civicrm_phone.is_primary = 1) LEFT JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1) LEFT JOIN civicrm_im ON (civicrm_location.id = civicrm_im.location_id AND civicrm_im.is_primary = 1) LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND
      civicrm_contact.id = civicrm_note.entity_id )
      LEFT JOIN civicrm_custom_value custom_value_2 ON custom_value_2.custom_field_id = 2 AND custom_value_2.entity_table = 'civicrm_contact' AND custom_value_2.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_4 ON custom_value_4.custom_field_id = 4 AND custom_value_4.entity_table = 'civicrm_contact' AND custom_value_4.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_5 ON custom_value_5.custom_field_id = 5 AND custom_value_5.entity_table = 'civicrm_contact' AND custom_value_5.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_6 ON custom_value_6.custom_field_id = 6 AND custom_value_6.entity_table = 'civicrm_contact' AND custom_value_6.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_7 ON custom_value_7.custom_field_id = 7 AND custom_value_7.entity_table = 'civicrm_contact' AND custom_value_7.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_9 ON custom_value_9.custom_field_id = 9 AND custom_value_9.entity_table = 'civicrm_contact' AND custom_value_9.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_10 ON custom_value_10.custom_field_id = 10 AND custom_value_10.entity_table = 'civicrm_contact' AND custom_value_10.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_11 ON custom_value_11.custom_field_id = 11 AND custom_value_11.entity_table = 'civicrm_contact' AND custom_value_11.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_20 ON custom_value_20.custom_field_id = 20 AND custom_value_20.entity_table = 'civicrm_contact' AND custom_value_20.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_13 ON custom_value_13.custom_field_id = 13 AND custom_value_13.entity_table = 'civicrm_contact' AND custom_value_13.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_14 ON custom_value_14.custom_field_id = 14 AND custom_value_14.entity_table = 'civicrm_contact' AND custom_value_14.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_15 ON custom_value_15.custom_field_id = 15 AND custom_value_15.entity_table = 'civicrm_contact' AND custom_value_15.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_16 ON custom_value_16.custom_field_id = 16 AND custom_value_16.entity_table = 'civicrm_contact' AND custom_value_16.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_19 ON custom_value_19.custom_field_id = 19 AND custom_value_19.entity_table = 'civicrm_contact' AND custom_value_19.entity_id = civicrm_contact.id
      LEFT JOIN civicrm_custom_value custom_value_21 ON custom_value_21.custom_field_id = 21 AND custom_value_21.entity_table = 'civicrm_contact' AND custom_value_21.entity_id = civicrm_contact.id LEFT JOIN civicrm_group_contact ON civicrm_contact.id = civicrm_group_contact.contact_id WHERE civicrm_contact.domain_id = 1 AND civicrm_contact.contact_type IN ('Organization') AND civicrm_group_contact.group_id IN (7) AND civicrm_group_contact.status IN ("Added") AND custom_value_5.memo_data LIKE '%%' AND LOWER(custom_value_15.char_data) LIKE '%%' AND custom_value_10.decimal_data = [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 18]"]
      )

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              jackatlinc Jack Aponte
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: