Jump to content

Select Between Dates


jnull

Recommended Posts

I have the following select statement:

 

SELECT * FROM `events` WHERE `Category` = "one" OR `Category` = "two" OR `Category` = "three" AND (`StartDate` BETWEEN "2011-06-30" AND "2011-07-05") ORDER BY `Category`

 

It returns data for all date ranges in the categories specified, which is incorrect.

 

If I only have

 

SELECT * FROM `events` WHERE `StartDate` BETWEEN "2011-06-30" AND "2011-07-05" ORDER BY `Category`

 

it returns nothing which is correct response.

 

Can you give me any idea of what's up with the first select statement?

 

Link to comment
https://forums.phpfreaks.com/topic/240314-select-between-dates/
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.