Hi Reeza
Thank you for your questions
I am trying to select subjects for a period of two years which is 6 terms
For instance for subject one, those terms are
ID
TERM_Code
Term_Desc
Consecutive Terms
1
201520
Spring 2015
1
1
201530
Summer 2015
2
1
201610
Fall 2015
3
1
201620
Spring 2016
4
1
201630
Summer 2016
5
1
201710
Fall 2016
6
The other two twrms 201720, Spring 2017 and TErm 201730, Summer 2017 are not included because there are
not included in those criteria
The other two subjects ID=2 and ID=3 have not completed the cycle of their two years.
The updated HAVE table is here:
ID
TERM_Code
Term_Desc
1
201520
Spring 2015
1
201530
Summer 2015
1
201610
Fall 2015
1
201620
Spring 2016
1
201630
Summer 2016
1
201710
Fall 2016
1
201720
Spring 2017
1
201730
Summer 2017
1
201810
Fall 2019
2
201710
Fall 2016
2
201720
Spring 2017
*Skipped 201730, Summer 2017
2
201810
Fall 2017
2
201820
Spring 2018
2
201830
Summer 2018
3
201510
Fall 2014
3
201520
Spring 2015
The WANT table is here
ID
TERM_Code
Term_Desc
Yr1
Yr2
1
201520
Spring 2015
Yes
Yes
1
201530
Summer 2015
Yes
Yes
1
201610
Fall 2015
Yes
Yes
1
201620
Spring 2016
Yes
Yes
1
201630
Summer 2016
Yes
Yes
1
201710
Fall 2016
Yes
Yes
2
201710
Fall 2016
Yes
No
2
201720
Spring 2017
Yes
No
2
201810
Fall 2017
Yes
No
2
201820
Spring 2018
Yes
No
2
201830
Summer 2018
Yes
No
3
201510
Fall 2014
No
No
3
201520
Spring 2015
No
No
Might this makes a little bit more sense?
... View more