I want to join both of them and also time interval must be not repeated and at the end I want to have some table like: Pernr BegDat EndDat B A 760 01.01.1960 15.01.2020 2300 02 760 16.01.2020 31.12.2023 2300 03 760 01.01.2024 15.01.2024 2200 03 760 16.01.2024 11.06.2024 2500 03 571 01.01.1998 15.03.2012 2200 02 571 16.03.2012 10.05.2020 2200 03 571 11.05.2020 15.12.2020 2200 04 571 16.12.2020 15.08.2022 2500 04 571 16.08.2022 01.12.2022 2100 04 571 02.12.2022 15.06.2023 2500 04 571 16.06.2023 31.12.2023 2300 04 571 01.01.2024 11.06.2024 2200 02 I couldnt write very good script in data model. who can write something for me? many thanks