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 CiviReport (Moderator: Dave Greenberg) »
  • Error when using smart group(s) in CiviReports
Pages: [1]

Author Topic: Error when using smart group(s) in CiviReports  (Read 1677 times)

Andrew Godfrey

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
    • Alpha International
Error when using smart group(s) in CiviReports
February 25, 2011, 02:30:20 pm
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 an active relationship. Can anybody help?

Thanks in advance!

Code: [Select]
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]"]
)
« Last Edit: February 25, 2011, 02:33:40 pm by Andrew Godfrey »

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: Error when using smart group(s) in CiviReports
February 25, 2011, 02:39:49 pm

hey andrew:

this is a bug (the date string needs to be quoted)

can you please file an issue and we'll fix for the next release

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

Andrew Godfrey

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
    • Alpha International
Re: Error when using smart group(s) in CiviReports
February 26, 2011, 10:32:05 am
Thanks Lobo...

I have raised the bug in JIRA...

A.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Error when using smart group(s) in CiviReports

This forum was archived on 2017-11-26.