Hi i need help, i have two table below, table1 is payment_transactions( consisting of all collections transactions), and the other table is ITC_data(consisting of credit score and lapse score). all i need is every record from payment_transactions table with itc_score and lapse_scores(date_received) <= trans_date for each record. If particular policy number have two received dates<=action_date, i need to take one(latest record) to avoid duplicates
Data Have
table1(payment_transactions table) table2(ITC_data)
policy_no trans_date amount policy_no date_received lapse_score itc_score
1 01Jan2019 500 1 01Dec2018 50 500
1 01Feb2019 500 2 01Jan2019 10 700
2 30Jan2019 300 2 15Jan2019 30 610
2 30Feb2019 300
Data Want
policy_no trans_date amount date_received lapse_score itc_score
1 01Jan2019 500 01Dec2018 50 500
1 01Feb2019 500 01Dec2018 50 500
2 30Jan2019 300 15Jan2019 30 610
2 30Feb2019 300 15Jan2019 30 610
... View more