Hi Michel,
Perfect!!!!! It works well after inserting your code to the SQL place!
---------------
I have another question, please. Since I created a combo box to choose the
Department names, the WHERE section is more complicates. Therefore, when I
ran the query, I got the error message " too complex or the expression is
typed incorrectly." Please see the code below. Thank you so much!
WHERE (((Conjuntion.Department)=Forms!frmDepartmentDateRange!Combo0)) &
[Between this date]<=EndDate And [And this date]>=StartDate;
--------------------------------------------
I added the "&" on it. Do you think that causes the problem?
Again, your code works perfectly without the combo box.
--------------------------------------------------------------------------------
Michel Walsh said:
It seems you wish to detect even partial overlap:
SELECT *
FROM somewhere
WHERE [parameterStartDate] <= EndDate AND [parameterEndDate] >=
StartDate
Hoping it may help
Vanderghast, Access MVP
Chi said:
Hi Michel,
To continue on what you helped me last time, I have more questions
about
this, please.
StartDate EndDate
Student 1 01/15/07 12/15/07
Student2 02/16/07 05/01/08
Student3 04/01/06 04/01/07
Student4 01/01/06 01/14/07
If I enter StartDate: 01/15/07 and EndDate: 12/15/07, I would like to
have
student1 , student 2 and student 3 in my query since either their
StartDate
or EndDate fall between these dates ( between 01/15/07 and 12/15/07),
but
not
student 4 since his StartDate and EndDate is not between 01/15/07 and
12/15/07.
Would you please help me on this new criteria?
Thanks
Chi
:
WHERE StartDate >= [From this date] AND EndDate <= [To this
date]
will pick records where the event described by the record occurs
entirely
between the two dates you supply as parameter.
WHERE EndDate >= [From this date] AND StartDate <= [To this date]
will pick records where the event occurs in part between the two dates
you
supply as parameter.
Vanderghast, Access MVP
Hi,
I have two fields: StartDate and EndDate.
Ex: StartDate EndDate
01/15/07 05/12/07
02/16/07 08/10/08
03/25/07 12/12/08
02/12/07 12/08/08
In my query screen, I use "Between [From this date] And [To this
date]"criteria under StartDate field. It works fine.
For this time, I would like to pull out the records from two fields:
StartDate and EndDate. Would you please help me on the criteria?
Thanks
Chi