I've added start/end date field to term. And added term with start/end field values 2011-05-12 / 2011-06-11.
And then created views block which generates nodes from current active (by start/end date fields) terms (start_date_value <= current_date <= end_date_value). Views query code seems correct. But result does not (empty result). But I changed the views filter to (current_date <= start_date_value AND current_date <= end_date_value) then it returns result. But my start/end date fields values are 2011-05-12 / 2011-06-11. I checked mysql table values.
They are

expire_date	            start_date
2011-06-11 00:00:00	2011-05-12 00:00:00

Views Query :

SELECT node.nid AS nid, 
node.title AS node_title, 
node.type AS node_type, 
term_data.name AS term_data_name, 
term_data.vid AS term_data_vid, 
term_data.tid AS term_data_tid, 
term_fields_term.expire_date AS term_fields_term_expire_date, 
term_fields_term.tid AS term_fields_term_tid, 
term_fields_term.start_date AS term_fields_term_start_date, 
DATE_FORMAT((FROM_UNIXTIME(node.created) + INTERVAL 28800 SECOND), '%Y%m%d%H') AS node_created_hour, 
node.changed AS node_changed 
FROM wms_node node  
LEFT JOIN wms_term_node term_node ON node.vid = term_node.vid 
LEFT JOIN wms_term_data term_data ON term_node.tid = term_data.tid 
LEFT JOIN wms_term_fields_term term_fields_term ON term_data.tid = term_fields_term.tid 
WHERE (node.status <> 0) 
AND (node.type in ('image')) 
AND (term_fields_term.expire_date >= ***CURRENT_TIME***-1) 
AND (term_fields_term.start_date <= ***CURRENT_TIME***-1) 
ORDER BY node_created_hour DESC, node_changed DESC

I copy/paste this query to phpmyadmin then it returns correct result.

I can't find any solution. Please help me.

Comments

gobioasis’s picture

views 6.x-2.12
drupal 6.22