Page 1 of 1

Dates driving me bonkers! Can someone check this...

Posted: Thu Mar 20, 2008 3:53 pm
by sarah_h
Hi all,

I'm working with the calendar module and have set up a 'next 7 days' template but I'm falling down on the MySQL select. I need to select all entries between today and this time next week i.e. 7 days in advance. I've read loads and tried several things like this:

... "WHERE $events_table_name.event_date_start BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 7 DAY ) AND DATE_SUB( CURDATE( ) ,INTERVAL 0 DAY"

and this:

"WHERE (DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= $events_table_name.event_date_start)";

But they don't work and crash out with an error 'Fatal error: Call to a member function on a non-object in c:\program files'. Now I don't think this is because I'm using MySQL 3.53! I think it's to more with the constrauction of this part of the sql.

All this should do is return all records from $events_table_name.event_date_start to 7 days from now.

Can anyone help?

Sarah

Re: Dates driving me bonkers! Can someone check this...

Posted: Thu Mar 20, 2008 9:20 pm
by alby
sarah_h wrote: ... "WHERE $events_table_name.event_date_start BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 7 DAY ) AND DATE_SUB( CURDATE( ) ,INTERVAL 0 DAY"

and this:

"WHERE (DATE_SUB(CURDATE(),INTERVAL 7 DAY) of -7days and not limited


Have you enable debug in config and check your logs for errors?

Alby