C
ChuckW
Hello,
I have a cross tab query below which creates a table that has years as row
headers and months as column or field headers. There is also a field called
ListId which is the customer number and type which is the category of client
that are row headers as well. I have my sql below for the cross tab query.
------------------------------------------------------------------------------------
TRANSFORM Sum(MonthlySalesElisa.Sales) AS SumOfSales
SELECT MonthlySalesElisa.ListID, MonthlySalesElisa.Type,
MonthlySalesElisa.Year, Sum(MonthlySalesElisa.Sales) AS [Total Of Sales]
FROM MonthlySalesElisa
GROUP BY MonthlySalesElisa.ListID, MonthlySalesElisa.Type,
MonthlySalesElisa.Year
PIVOT MonthlySalesElisa.Month;
--------------------------------------------------------------------------------------
I have a separate table called Budget20008 that lists clientID and the 12
months of the year as column or field headers. The records in this table
have all of our clients and the projected sales for each month.
What I want to do is to somehow combine the results of this cross tab with
the data from the Budget2008 table. The combined data would look like the
following:
ListID Year Type Jan Feb Mar Apr May Jun Jul Aug Sep Oct
Nov Dec
1101 2007 C $100 $200 $150 $200 $300 $200 $100 $150 $300 $275 $200 $100
1101 2008 C $150
1101 Budget C $200
The first two records would come from the cross tab query while the third
record would come from the Budget2008 table. I wanted to run some type of
union query that could capture both. I tried running one but received an
error message stating that states "Cannot use the crosstab of a non-fixed
cloumn as a subquery.
Can someone help?
I have a cross tab query below which creates a table that has years as row
headers and months as column or field headers. There is also a field called
ListId which is the customer number and type which is the category of client
that are row headers as well. I have my sql below for the cross tab query.
------------------------------------------------------------------------------------
TRANSFORM Sum(MonthlySalesElisa.Sales) AS SumOfSales
SELECT MonthlySalesElisa.ListID, MonthlySalesElisa.Type,
MonthlySalesElisa.Year, Sum(MonthlySalesElisa.Sales) AS [Total Of Sales]
FROM MonthlySalesElisa
GROUP BY MonthlySalesElisa.ListID, MonthlySalesElisa.Type,
MonthlySalesElisa.Year
PIVOT MonthlySalesElisa.Month;
--------------------------------------------------------------------------------------
I have a separate table called Budget20008 that lists clientID and the 12
months of the year as column or field headers. The records in this table
have all of our clients and the projected sales for each month.
What I want to do is to somehow combine the results of this cross tab with
the data from the Budget2008 table. The combined data would look like the
following:
ListID Year Type Jan Feb Mar Apr May Jun Jul Aug Sep Oct
Nov Dec
1101 2007 C $100 $200 $150 $200 $300 $200 $100 $150 $300 $275 $200 $100
1101 2008 C $150
1101 Budget C $200
The first two records would come from the cross tab query while the third
record would come from the Budget2008 table. I wanted to run some type of
union query that could capture both. I tried running one but received an
error message stating that states "Cannot use the crosstab of a non-fixed
cloumn as a subquery.
Can someone help?