Hi guys,

In my application users can search for events that fall with in a particular date range, which works fine. The problem I am having is getting records when I ask for the current months events using the query below.

select * From Events
Where FromDate >='1/1/2010' And ToDate <=1/31/2010

I want the record below to show up because its start date is in the current month, but it doesn’t because of todate param is not less than 2/1/2010


How do a create a query that will give me only the records for the current month if the have a fromdate or todate within in a given time period. (ie current month, current week, etc.)



Select *
From Events
Where (FromDate >= '01/01/2010' And FromDate < '02/01/2010')
Or (ToDate >= '01/01/2010' And ToDate < '02/01/2010')