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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
sarah_h
Forum Members
Forum Members
Posts: 189
Joined: Tue Apr 25, 2006 8:30 am

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

Post 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
alby

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

Post 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
Post Reply

Return to “CMSMS Core”