[Solved] How to join tables in SQL Server by date Valid_from/Valid_to


Please put your queries in text, not images. You can use JOINS to achieve this or you can do like this

SELECT A.ID, A.DATE,A.AMOUNT, B.NAME
FROM test_T_cust A 
     INNER JOIN test_M_cust B
     ON A.ID=B.ID AND
A.DATE BETWEEN B.V_FROM AND B.V_TO;

3

solved How to join tables in SQL Server by date Valid_from/Valid_to