Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with date range query. Please Help.

Status
Not open for further replies.

Candles

Programmer
Nov 7, 2001
12
AU
Hi I am creating a query based on a date range. I am currently using Between .... And however this isn't producing the right result.

I have 2 parameters (Start Date, End Date) for the date range but I want the result to return the records so that if a start date is before the specified start date but the record extends into the date range or after the date range it will still get pulled out.

Any ideas??

Thanks, Tasch
 
You are going to need to use the OR clause:

WHERE MyTable.StartDate BETWEEN StartParameter AND EndParameter OR
MyTable.EndDate BETWEEN StartParameter AND EndParameter

Hope that helps... Terry M. Hoey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top