0

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

eventid:1
eventname:vacation
fromdate:1/29/2010
todate: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.)

Thanks,


tom

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by mcdt2424
0
Select *
From Events
Where (FromDate >= '01/01/2010' And FromDate < '02/01/2010')
Or (ToDate >= '01/01/2010' And ToDate < '02/01/2010')
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.