G
Guest
I am creating a report that shows crosstab figures. To double check the
correctness, I also created a pivot table based on the same query as crosstab
uses. Then I get slightly different values from these two tables, the
difference seemingly bigger than simply the matter of rounding or truncation.
I don't understand why this happens, and wonder if someone have experienced
this before. The following is the SQL for the cross tab.
TRANSFORM Sum([transaction].bought) AS SumOf bought
SELECT [transaction].[_product], [transaction]._country_of_origin
FROM [transaction]
GROUP BY [transaction].[_product], [transaction]._country_of_origin
PIVOT [transaction].[_reporting_year] In ("2002","2003","2004","2005","2006");
and the following is the SQL for query that is the base for pivot table.
SELECT [transaction].[_product], [transaction]._bought,
[transaction].[_reporting_year], [transaction]._country_of_origin
FROM [transaction];
I will appreciate greatly for your suggestions and insights.
Thanks,
correctness, I also created a pivot table based on the same query as crosstab
uses. Then I get slightly different values from these two tables, the
difference seemingly bigger than simply the matter of rounding or truncation.
I don't understand why this happens, and wonder if someone have experienced
this before. The following is the SQL for the cross tab.
TRANSFORM Sum([transaction].bought) AS SumOf bought
SELECT [transaction].[_product], [transaction]._country_of_origin
FROM [transaction]
GROUP BY [transaction].[_product], [transaction]._country_of_origin
PIVOT [transaction].[_reporting_year] In ("2002","2003","2004","2005","2006");
and the following is the SQL for query that is the base for pivot table.
SELECT [transaction].[_product], [transaction]._bought,
[transaction].[_reporting_year], [transaction]._country_of_origin
FROM [transaction];
I will appreciate greatly for your suggestions and insights.
Thanks,