Main Table | ||
Record ID | Date | |
1 | 1/30/2021 | |
2 | 6/1/2021 | |
Lookup Table | ||
Record ID | Start Date | End Date |
1 | 1/1/2021 | 2/1/2021 |
1 | 3/1/2021 | 4/1/2021 |
1 | 5/1/2021 | 7/1/2021 |
2 | 6/6/2021 | 6/30/2021 |
2 | 7/1/2021 | 8/1/2021 |
Result Desired | ||
Record ID | Date | Flag |
1 | 1/30/2021 | 1 |
2 | 6/1/2021 | 0 |
Record Id is unique in main table but is duplicated in look up table. If the date of record ID on the main table exists between start and end dates in lookup table, flag that as 1 else flag it as 0.
How can I achieve this? Thanks in advance. Note this is just a sample, these tables have thousands of records.
Solved! Go to Solution.
We can first translate thoest field for Date to Date format by DateTime tool then join the Record ID.