I have a crosstab table which contains a count of bad parts found every month by part number for 12 months.
I would like to create a query to total the amounts of each month so that I can display the total bad parts in each month.
I have tried to sum the amounts in the table with a query but I get the same results as if I group each items, where I get a list of each part per month...
Here is was the two queries look like and they produce the same results:
and
What am I doing wrong?
Thanks
I would like to create a query to total the amounts of each month so that I can display the total bad parts in each month.
I have tried to sum the amounts in the table with a query but I get the same results as if I group each items, where I get a list of each part per month...
Here is was the two queries look like and they produce the same results:
Code:
SELECT DISTINCTROW [1badparts_tbl].[Part Number], [1badparts_tbl].Desc, [1badparts_tbl].Jan, [1badparts_tbl].Feb, [1badparts_tbl].Mar, [1badparts_tbl].Apr, [1badparts_tbl].May, [1badparts_tbl].Jun, [1badparts_tbl].Jul, [1badparts_tbl].Aug, [1badparts_tbl].Sep, [1badparts_tbl].Oct, [1badparts_tbl].Dec
FROM 1badparts_tbl
GROUP BY [1badparts_tbl].[Part Number], [1badparts_tbl].Desc, [1badparts_tbl].Jan, [1badparts_tbl].Feb, [1badparts_tbl].Mar, [1badparts_tbl].Apr, [1badparts_tbl].May, [1badparts_tbl].Jun, [1badparts_tbl].Jul, [1badparts_tbl].Aug, [1badparts_tbl].Sep, [1badparts_tbl].Oct, [1badparts_tbl].Nov, [1badparts_tbl].Dec;
and
Code:
SELECT DISTINCTROW [1badparts_tbl].[Part Number], [1badparts_tbl].Desc, Sum([1badparts_tbl].Jan) AS SumOfJan, Sum([1badparts_tbl].Feb) AS SumOfFeb, Sum([1badparts_tbl].Mar) AS SumOfMar, Sum([1badparts_tbl].Apr) AS SumOfApr, Sum([1badparts_tbl].May) AS SumOfMay, Sum([1badparts_tbl].Jun) AS SumOfJun, Sum([1badparts_tbl].Jul) AS SumOfJul, Sum([1badparts_tbl].Aug) AS SumOfAug, Sum([1badparts_tbl].Sep) AS SumOfSep, Sum([1badparts_tbl].Oct) AS SumOfOct, Sum([1badparts_tbl].Nov) AS SumOfNov, Sum([1badparts_tbl].Dec) AS SumOfDec
FROM 1badparts_tbl
GROUP BY [1badparts_tbl].[Part Number], [1badparts_tbl].Desc;
What am I doing wrong?
Thanks