pr2-eugin
Super Moderator
- Local time
- Today, 11:59
- Joined
- Nov 30, 2011
- Messages
- 8,494
I am having a fry up day. I am trying to figure out a logical WHERE condition.
I have a Query that gives me data,
Now in the above example, I want to have only Paul and Francis. As Eugin start is 21-05-2015 and End is the same month, so is Samuel's. So I want to eliminate those two records.
I have checked pbaldy's web of overlapping records. But unlike that, I need something customised.
Begins and ends before range - we don't want - Yes
Begins before, ends during - we want this one - Yes
Begins and ends during - we want this one too - NO
Begins during and ends after - we also want this one - Yes
Begins and ends after - we don't want this one - Yes
Begins before and ends after - we want this one -NO
Could someone help me figure out the logic? Please !!
I have a Query that gives me data,
Code:
Name | Start | End
--------+-----------------+-------------
[COLOR=Red]Paul[/COLOR] | 30-May-15 |
[COLOR=RoyalBlue]Eugin[/COLOR] | 21-May-15 | 28-May-15
[COLOR=Red]Francis[/COLOR] | 04-Mar-15 | 08-May-15
[COLOR=RoyalBlue]Samuel[/COLOR] | 10-May-15 | 13-May-15
I have checked pbaldy's web of overlapping records. But unlike that, I need something customised.
Begins and ends before range - we don't want - Yes
Begins before, ends during - we want this one - Yes
Begins and ends during - we want this one too - NO
Begins during and ends after - we also want this one - Yes
Begins and ends after - we don't want this one - Yes
Begins before and ends after - we want this one -NO
Could someone help me figure out the logic? Please !!