Weird timestamp problem
Hi, I have created an sql query using views to select some content filtered by a custom cck date (Y-m-d).
I have two nodes: one with a date of 2008-09-01 and 2009-01-25.
I want to show only the content that is between 2001 and the 'now' keyword.
The View module translated this desire into:
WHERE ((DATE_FORMAT(FROM_UNIXTIME(node_data_field_rdate.field_rdate_value), '%Y-%m-%d') >= '2001-01-10') AND (DATE_FORMAT(FROM_UNIXTIME(node_data_field_rdate.field_rdate_value), '%Y-%m-%d') <= '2009-01-08'))Up to that point, no problem, the live preview only shows the node with the 2008-09-01 date, not the 2009-01-25 since it's not today yet.
Now, I'm trying to incorporate this into a block, and to my surprise, the node with a date of 2009-01-25. I use the exact same SQL query, and use this to process it:
$result = db_query($sql);
while ($data = db_fetch_object($result)) {
// some code here
}If I change the date to 2009-02-25, then this one is not displayed anymore. It's like when it's embedded in a block, it's ignoring the "day" value and only takes into account the "year" and "month". Is there a way to filter by the day too in the block?
Thanks for your help,

I have been able to make it
I have been able to make it work by using direct timestamps rather than conversion into a date format:
$today = time();and the sql part:
AND node_data_field_rdate.field_rdate_value >= '978325200' AND node_data_field_rdate.field_rdate_value <= '$today'I still don't know, however, what was wrong with the previous query.