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

pauldawg’s picture

Title: Bug in calendar view with Distinct nodes referring to multiple fields » Cannot create calendar view with Distinct nodes
Component: User interface » Code

update: 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

KarenS’s picture

Status: Active » Fixed

This 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.

pauldawg’s picture

Thanks. I will give the DEV versions a try.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.