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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Between statement ?

Status
Not open for further replies.

corrado

Technical User
Jan 29, 2002
13
US
I have a query that is based on a table and have a column of data that shows completion dates of (11/15/02, 11/02/02,11/17/02, etc...) I want to prompt the user to enter in a start date and an end date and want to show any data that is included in this start/end date. I have the following SQL, but it only brings back the actual date that is entered in the start or end, NOT all the dates in between. So if I enter a start date of 11/01/02 and an end date of 11/18/02- it should bring back all the dates in which this column shows data- which in this case is every row of data which has a date in between the start and end date of 11/01/02 and 11/18/02.

WHERE (((ASSEMBLY.[DATE COMPLETED TASK])=[enter start date:])) OR (((ASSEMBLY.[DATE COMPLETED TASK])=[enter end date:]));

should I be using a between somewhere? if so where??

Thank you for any responses...
DJ
 
WHERE (((ASSEMBLY.[DATE COMPLETED TASK])>=[enter start date:])) AND (((ASSEMBLY.[DATE COMPLETED TASK])<=[enter end date:]));
 
Thank you very much- I found that I was using OR instead of AND... Thanks again..

DJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top