Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
6.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2011 at 09:00 UTC
Updated:
26 Sep 2011 at 16:49 UTC
I have a view in which I show activities where I have set a filter on field_date. However, the filter does not work 100%. According to the code below it adds an "OR" SQL statement in the "WHERE" clause checking out the 'node.changed' value. I I leave this code out my view works as expected.
I just wonder why the View module adds this line to my SQL statement. Any suggestions?
Regards,
Nyborg
SELECT node_data_field_date.field_date_value AS node_data_field_date_field_date_value,
node_data_field_date.field_date_value2 AS node_data_field_date_field_date_value2,
node.type AS node_type,
node.nid AS nid,
node.vid AS node_vid,
node.title AS node_title,
node.language AS node_language
FROM node node
LEFT JOIN content_type_event node_data_field_date ON node.vid = node_data_field_date.vid
WHERE ((node.type in ('event'))
AND (node.status = 1))
AND (
(DATE_FORMAT(STR_TO_DATE(node_data_field_date.field_date_value2, '%Y-%m-%dT%T'), '%Y-%m-%d') >= '2011-09-21')
OR (
(DATE_FORMAT(FROM_UNIXTIME(node.changed), '%Y-%m') <= '2011-09' AND DATE_FORMAT(FROM_UNIXTIME(node.changed), '%Y-%m') >= '2011-09')))
ORDER BY node_data_field_date_field_date_value ASC, node_data_field_date_field_date_value2 ASC
Comments
Comment #1
dawehnerCan you just add a filter by changed and do exactly what you want?
Comment #2
MGParisi commentedTry '+0 minutes'
Is Now a Documented Feature?
Comment #3
merlinofchaos commentedThis is probably a date.module question in any case.