Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am dttempting to modify the calendar view so it returns "distinct" nodes and includes value1(from) OR value2(to) of the CCK Date field in the Argument. When previewing or displaying the view I get a SQL Syntax error.
user warning: 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 'DISTINCT(node.nid), node_data_field_schedule.field_schedule_value AS node_dat' at line 1 query: SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), node_data_field_schedule.field_schedule_value AS node_data_field_schedule_field_schedule_value, node_data_field_schedule.field_schedule_value2 AS node_data_field_schedule_field_schedule_value2, node.title AS node_title, node.changed AS node_changed, node_revisions.body AS node_revisions_body, node_revisions.format AS node_revisions_format, node.type AS node_type FROM node node LEFT JOIN content_type_event node_data_field_schedule ON node.vid = node_data_field_schedule.vid LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid WHERE ((STR_TO_DATE(node_data_field_schedule.field_schedule_value, '%Y-%m-%dT%T') >= '2008-07-01 04:00:00' AND STR_TO_DATE(node_data_field_schedule.field_schedule_value, '%Y-%m-%dT%T') <= '2008-08-01 03:59:59')) OR ((STR_TO_DATE(node_data_field_schedule.field_schedule_value2, '%Y-%m-%dT%T') >= '2008-07-01 04:00:00' AND STR_TO_DATE(node_data_field_schedule.field_schedule_value2, '%Y-%m-%dT%T') <= '2008-08-01 03:59:59')) in /home/content/s/h/a/shantijoonu/html/drupal_dev/sites/all/modules/views/includes/view.inc on line 681.
Comments
Comment #1
pauldawg CreditAttribution: pauldawg commentedupdate: this error occurs regarless of whether I have multiple field values; if I remove one of the values I still cannot use the Distinct option
Comment #2
KarenS CreditAttribution: KarenS commentedThis is a Views bug, the Calendar can't do anything about it. Are you using the very latest version of Views? I know this was reported on the Views issue queue, but don't know if Earl found a fix. I won't move the issue over there because I'm pretty sure there is already an issue about this. If upgrading Views doesn't work, hunt through the Views issues for a suggestion.
While you're at it, upgrade from Calendar and Date beta3 to the latest -dev code for both of them. Lots of things are broken in beta3 that have since been fixed in -dev.
Comment #3
pauldawg CreditAttribution: pauldawg commentedThanks. I will give the DEV versions a try.
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.