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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.