• Hi guys,

    Below is an example of my data using a create and insert.

    --===== Create the test table with

    Create table Admission

    (Contract Varchar(4),

    Admissiondate Varchar(6),

    SumofCost DECIMAL(19, 4));

    --===== Insert the test data into the test table

    Insert into Admission

    (Contract,Admissiondate,SumofCost)

    Values

    ('0606','200701','8639.38'),

    ('0607','200702','22895.94'),

    ('0608','200703','123752.28'),

    ('0609','200704', '61378.49')

    --===== Create the test table with

    Create table Members

    (Contract Varchar(4),

    Admissiondate Varchar(6),

    CountofMembers INT;

    --===== Insert the test data into the test table

    Insert into Members

    Values

    ('0606','200701', '86'),

    ('0607', '200702', '102'),

    ('0608', '200703', '90'),

    ('0609', '200704', '120')

    -====== Likely Output

    Contract Admissiondate 3 month average cost

    0606 200701

    0607 200702

    0608 200703

    0609 200704 $577.85