Krish wrote:
After doing some search on the internet, I think I have a more compact filter to achieve the same results:
The filter can be replaced with:
filter.PredicateExpression.Add(EventFields.StartDate <= newEvent.EndDate
&& newEvent.StartDate <= EventFields.EndDate > );
Please tell me if above is wrong.
Seems nice. However depending on what do you want it may result in false positives. What overlap means in this situation? that is the question? Consider the following
Overlap 1 (the date range is completely inside the range of the new event)
Some DB Event
StartDate = 01/March/2010
EndDate = 05/March/2010
Your new Event
StartDate = 02/March/2010
EndDate = 04/March/2010
Overlap 2 (either startDate or endDate are inside the range of the new event)
Some DB Event
StartDate = 01/March/2010
EndDate = 05/March/2010
Your new Event
StartDate = 20/Feb/2010
EndDate = 04/March/2010
In Overlap2, the filter will pass only in the second part of the &&, as a result in this case, it appears as if there is not overlap, but the StarDate of the DB Event overlaps the date range of the new event. If this is a person schedule, such person will be in troubles between 01/March and 04/March
Just a thought, it may be that Overlap1 is what you want.
Krish wrote:
Thanks very much for the prompt reply. But during the last month or so I noticed, I am not notified by email when a response has been posted even though I always select notify me.
Can you please check this.
You are welcome. Please review your spam box, maybe we are there. Also check that you have registered the correct email address in your profile.