Avatar of Rickzzz
Rickzzz
 asked on

SQL Recursive Select

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
SQL

Avatar of undefined
Last Comment
skullnobrains

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
skullnobrains

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rickzzz

ASKER
Man did I overthink that... thanks!
skullnobrains

Good to know and happy coding. Thanks
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck