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

MySQL syntax error when using smart group(s) in CiviReports which are based on dates.

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.3.2
    • Fix Version/s: 3.4.alpha
    • Component/s: CiviReport
    • Labels:
      None

      Description

      Hello,

      We are trying to use smart groups as a search criteria in all CiviReports, but we get the following error. The smart group is based on dates within a relationship.

      Thanks in advance for sorting out for all of us!

      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 '22:24:06)) >= 0))' at line 4, 1064
      Additional Details:
      Array
      (
      [callback] => Array
      (
      [0] => CRM_Core_Error
      [1] => handle
      )

      [code] => -2
      [message] => DB Error: syntax error
      [mode] => 16
      [debug_info] =>
      SELECT g.id
      FROM civicrm_group g
      WHERE g.id IN ( 11 ) AND ( g.saved_search_id IS NOT NULL OR g.children IS NOT NULL ) AND
      (g.cache_date IS NULL OR (TIMESTAMPDIFF(MINUTE, g.cache_date, 2011-02-25 22:24:06)) >= 0))
      [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 '22:24:06)) >= 0))' at line 4]
      [type] => DB_Error
      [user_info] =>
      SELECT g.id
      FROM civicrm_group g
      WHERE g.id IN ( 11 ) AND ( g.saved_search_id IS NOT NULL OR g.children IS NOT NULL ) AND
      (g.cache_date IS NULL OR (TIMESTAMPDIFF(MINUTE, g.cache_date, 2011-02-25 22:24:06)) >= 0))
      [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 '22:24:06)) >= 0))' at line 4]
      [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
      SELECT g.id
      FROM civicrm_group g
      WHERE g.id IN ( 11 ) AND ( g.saved_search_id IS NOT NULL OR g.children IS NOT NULL ) AND
      (g.cache_date IS NULL OR (TIMESTAMPDIFF(MINUTE, g.cache_date, 2011-02-25 22:24:06)) >= 0))
      [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 '22:24:06)) >= 0))' at line 4]"]

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              agodfrey Andrew Godfrey
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: