We help IT Professionals succeed at work.
Get Started

SQL Recursive Select

Rickzzz
Rickzzz asked
on
64 Views
Last Modified: 2019-12-09
I have a table with with 3 columns I need to key on to build triangle data.

EffectiveMonth = 01/2017, 02/2017, 03/2017... to current month
TransactionEffectiveMonth = 01/2017, 02/2017, 03/2017... to current month
TotalPremium = 20.00

I need to sum each effective month as of each transaction effective month.

So, I need the sum of TotalPremium for each EffectiveMonth, as of each TransactionEffectiveMonth so that the data returned is represented as shown in the attached image.

EffectiveMonth only needs to be evaluted as of 2 years out. Hopefully the attached image defines that for you as well.

Thanks in advance!!
Triangle Data
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE