dwain.c, Thanks for your insight thus far, I really appreciate it.
Your code is not working with my environment, and I'm not exactly sure why.
Below is the code from my environment that I use to pull my admissions data and my membership data.
Also, I have included the result from both query. Both these table would be use toegether to achieve a 3 month average cost.
Admission
SELECT
(ContractCode+'-'+BenefitPlanCode)As Contract,
AdmitCCYYMM,
IsNull(SUM(AmountPaid),0) AS Cost
FROM
factAdmissions
Where ContractCode Is not null
And BenefitPlanCode Is not null
GROUP BY
ContractCode,
BenefitPlanCode,
AdmitCCYYMM
Order by 1,2
Contract AdmitCCYYMM Cost
P3347-001200701 8639.38
P3347-001200702 31895.94
P3347-001200703 213752.29
P3347-001200704 223869.89
P3347-001200705 61378.49
P3347-002200801 90198.43
P3347-002200802 125753.98
P3347-002200803 215915.85
Membership
SELECT
(ContractCode+'-'+BenefitPlanCode)As Product,
EffectiveCCYYMM,
count(memberid) AS numberofMembers
FROM
factMembership
GROUP BY
EffectiveCCYYMM,
ContractCode,
BenefitPlanCode
order by 1,2
ContractEffectiveCCYYMMnumberofMembers
P3347-001200701 104
P3347-001200702 200
P3347-001200703 310
P3347-001200704 218
P3347-001200705 318
H3347-002200801 257
H3347-002200802 309
H3347-002200803 330