Jump to content

[SOLVED] QUERY HELP


Canman2005

Recommended Posts

Hi

 

I have a further question to my last post, but its slightly different.

 

I have a table called "events" with a "start_date" and "end_date", the dates are stored as YYYY-MM-DD

 

an example table would be

 

ID  START_DATE    END_DATE

1    2007-03-23    2007-03-28

2    2007-04-02    2007-04-02

 

I want to run a query on this table and return all rows that have todays date and the next 6 days (so 1 week) within the START_DATE and END_DATE fields.

 

So if todays date was 2007-03-26, then it would return only row 1 from the above example table, and if todays date was the 2007-04-01 then it would return just row 2 as it has a START_DATE starting the next day.

 

Does that make sense?

 

I have tried to do this query with the BETWEEN function, but it doesnt seem to be returning the correct result and sometimes no result.

 

Can anyone help me?

 

Thanks in advance

 

Dave

Link to comment
https://forums.phpfreaks.com/topic/51226-solved-query-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.