H
hoachen
Dear Experts, I need help on this calculation!
The SQL below were joined by two crosstab queries. I would like to add the
columns that will calculate the % on how many item issued per month and again
how many item received per that month as well as add a total per year
calculation for the entire year % received against total item issued per
year.
SELECT [Item Count by Month].[Supplier#], [Item Count by
Month].SupplierName, [Item Count by Month].[Total All Item], [Item Received
by Month].[Total Item Received], [Item Count by Month].[Total Item Open],
[Item Count by Month].[Total Item Closed], [Item Count by Month].[Aug 09],
[Item Count by Month].[Jul 09], [Item Count by Month].[Oct 09], [Item Count
by Month].[Sep 09], [Item Received by Month].[Sep 09] AS [Item Rcd on Sep 09]
FROM [Item Count by Month] LEFT JOIN [Item Received by Month] ON [Item Count
by Month].[Supplier#] = [Item Received by Month].[CustInfoProv#]
GROUP BY [Item Count by Month].[Supplier#], [Item Count by
Month].SupplierName, [Item Count by Month].[Total All Item], [Item Received
by Month].[Total Item Received], [Item Count by Month].[Total Item Open],
[Item Count by Month].[Total Item Closed], [Item Count by Month].[Aug 09],
[Item Count by Month].[Jul 09], [Item Count by Month].[Oct 09], [Item Count
by Month].[Sep 09], [Item Received by Month].[Sep 09];
Supplier# S.Name Aug Jul Sep Oct T.Open TClosed T.All RcdSep T.Rcd
525 ABC 2 48 2 30 81 1 82 1 1
796 JJK Co 8 0 5 13 0 13 5 5
Jul % Aug % Sept % Total % per year
0 0 50 1.22
0 0 100 38.46
The SQL below were joined by two crosstab queries. I would like to add the
columns that will calculate the % on how many item issued per month and again
how many item received per that month as well as add a total per year
calculation for the entire year % received against total item issued per
year.
SELECT [Item Count by Month].[Supplier#], [Item Count by
Month].SupplierName, [Item Count by Month].[Total All Item], [Item Received
by Month].[Total Item Received], [Item Count by Month].[Total Item Open],
[Item Count by Month].[Total Item Closed], [Item Count by Month].[Aug 09],
[Item Count by Month].[Jul 09], [Item Count by Month].[Oct 09], [Item Count
by Month].[Sep 09], [Item Received by Month].[Sep 09] AS [Item Rcd on Sep 09]
FROM [Item Count by Month] LEFT JOIN [Item Received by Month] ON [Item Count
by Month].[Supplier#] = [Item Received by Month].[CustInfoProv#]
GROUP BY [Item Count by Month].[Supplier#], [Item Count by
Month].SupplierName, [Item Count by Month].[Total All Item], [Item Received
by Month].[Total Item Received], [Item Count by Month].[Total Item Open],
[Item Count by Month].[Total Item Closed], [Item Count by Month].[Aug 09],
[Item Count by Month].[Jul 09], [Item Count by Month].[Oct 09], [Item Count
by Month].[Sep 09], [Item Received by Month].[Sep 09];
Supplier# S.Name Aug Jul Sep Oct T.Open TClosed T.All RcdSep T.Rcd
525 ABC 2 48 2 30 81 1 82 1 1
796 JJK Co 8 0 5 13 0 13 5 5
Jul % Aug % Sept % Total % per year
0 0 50 1.22
0 0 100 38.46