views:

156

answers:

1

I have to SQL Server views being drawn to 2 seperate worksheets as pivot tables in an excel 2007 file.

the results on worksheet1 include example data:

- company_name, tickets, month, year
company1, 3, 1,2009 
company2, 4, 1,2009 
company3, 5, 1,2009 
company3, 2, 2,2009 

results from worksheet2 include example data:

company_name, month, year , fee 
company1,      1   ,  2009   ,  2.00 
company2,      1   ,  2009   ,  3.00 
company3,      1   ,  2009   ,  4.00 
company3,      2   ,  2009   ,  2.00 

I would like the results of one worksheet to be reflected onto the pivot table of another with their corresponding companies.

for example in this case:

- company_name, tickets, month, year, fee 
company1, 3, 1,2009 , 2
company2, 4, 1,2009 , 3
company3, 5, 1,2009 , 4
company3, 2, 2,2009 , 2 

Is there a way to do this without vba?

thanks in advance

+2  A: 

figured it out. You can take the 2 views or tables in the database and use the SQL option to create a custom sql join in the definition tab under connection properties. You can then use this connection to create a Pivot table.

phill
Go ahead and accept this as the answer. That way others with this same problem will know this is the way to go.
guitarthrower
tried.. i gotta wait 13 more hours.
phill