Hello everyone I have two tables. I need to join them and connect the columns. Below are the two source tables and the third table is the desired table. In table 1 the first_term is the term that student began that program. Table 1 Id first_term Program 610 199601 Libarts 610 201001 Medtran 610 201102 Photo In table 2, the "term" column has all the terms the student has registered for a class. if the starting term in the "term" column is greater than or equal to the "first_term" in table 1, then it means that class (CRN number) is tied to that program. For example, the first program the student began is LIBARTS in 199601 (table 1). In table 2, we can see after 199601, this student took courses till the term reaches to the beginning of the new program which is 201001. This means the first 5 observations belong to the LIBARTS program. Table 2 Id Term CRN 610 199602 211 610 199702 213 610 200501 102 610 200903 302 610 200903 321 610 201001 124 610 201001 153 610 201001 150 610 201001 142 610 201002 225 610 201002 242 610 201002 244 610 201003 316 610 201101 103 610 201101 121 610 201101 142 610 201101 145 610 201102 242 610 201102 242 610 201103 315 610 201201 140 610 201201 140 610 201201 150 610 201202 211 610 201202 241 610 201202 242 Basically, the joined table should look like below. Id Term CRN Program 610 199602 211 Libarts 610 199702 213 Libarts 610 200501 102 Libarts 610 200903 302 Libarts 610 200903 321 Libarts 610 201001 124 Medtran 610 201001 153 Medtran 610 201001 150 Medtran 610 201001 142 Medtran 610 201002 225 Medtran 610 201002 242 Medtran 610 201002 244 Medtran 610 201003 316 Medtran 610 201101 103 Medtran 610 201101 121 Medtran 610 201101 142 Medtran 610 201101 145 Medtran 610 201102 242 Photo 610 201102 242 Photo 610 201103 315 Photo 610 201201 140 Photo 610 201201 140 Photo 610 201201 150 Photo 610 201202 211 Photo 610 201202 241 Photo 610 201202 242 Photo Any help will be greatly appreciated. Thanks.
... View more