M
Marlo Clark
I have a query built and am trying to create a report from that query. The
query runs fine, but the report does not. I get an error that says: "The
specified field 'Category' could refer to more than one table listed in the
FROM clause of your SQL statement. "
Below is the SQL from the query, but I can't seem to find where the error
is. Can someone help me?
Thanks
SELECT [Download Data].Period, [Download Data].Year, Category.Category,
Category.[Category Type], Category.[Unit of Measure], [Material Data].[GRD#],
[Material Data].Description, [PPV Detail by Period].[Std Spend], [PPV Detail
by Period].[Act Spend], [PPV Detail by Period].PPV, [Download Data].[Qty
Received], ([Download Data]![Qty Received]*Category![Volume
Multiplier])/Category![Volume Divisor] AS [Ton Volume], ([Download Data]![Std
Price]/Category![Currency Divisor])*Category![Currency Multiplier] AS [Ton
Std Price], ([Download Data]![Avg Price]/Category![Currency
Divisor])*Category![Currency Multiplier] AS [Ton Act Price], [Ton Std
Price]*[Ton Volume] AS [Ton Std Spend], [Ton Act Price]*[Ton Volume] AS [Ton
Act Spend], ([Ton Act Price]-[Ton Std Price])*[Ton Volume] AS [Ton PPV]
FROM (Category INNER JOIN ([Material Data] INNER JOIN [PPV Detail by Period]
ON [Material Data].[GRD#] = [PPV Detail by Period].[GRD#]) ON
(Category.Category = [Material Data].Category) AND (Category.Category = [PPV
Detail by Period].Category)) INNER JOIN [Download Data] ON [Material
Data].[GRD#] = [Download Data].[GRD#]
WHERE ((([Download Data].Period)=[Enter 2 Digit Period]) AND (([Download
Data].Year)=[Enter 4 Digit Year]))
ORDER BY [Material Data].[GRD#];
query runs fine, but the report does not. I get an error that says: "The
specified field 'Category' could refer to more than one table listed in the
FROM clause of your SQL statement. "
Below is the SQL from the query, but I can't seem to find where the error
is. Can someone help me?
Thanks
SELECT [Download Data].Period, [Download Data].Year, Category.Category,
Category.[Category Type], Category.[Unit of Measure], [Material Data].[GRD#],
[Material Data].Description, [PPV Detail by Period].[Std Spend], [PPV Detail
by Period].[Act Spend], [PPV Detail by Period].PPV, [Download Data].[Qty
Received], ([Download Data]![Qty Received]*Category![Volume
Multiplier])/Category![Volume Divisor] AS [Ton Volume], ([Download Data]![Std
Price]/Category![Currency Divisor])*Category![Currency Multiplier] AS [Ton
Std Price], ([Download Data]![Avg Price]/Category![Currency
Divisor])*Category![Currency Multiplier] AS [Ton Act Price], [Ton Std
Price]*[Ton Volume] AS [Ton Std Spend], [Ton Act Price]*[Ton Volume] AS [Ton
Act Spend], ([Ton Act Price]-[Ton Std Price])*[Ton Volume] AS [Ton PPV]
FROM (Category INNER JOIN ([Material Data] INNER JOIN [PPV Detail by Period]
ON [Material Data].[GRD#] = [PPV Detail by Period].[GRD#]) ON
(Category.Category = [Material Data].Category) AND (Category.Category = [PPV
Detail by Period].Category)) INNER JOIN [Download Data] ON [Material
Data].[GRD#] = [Download Data].[GRD#]
WHERE ((([Download Data].Period)=[Enter 2 Digit Period]) AND (([Download
Data].Year)=[Enter 4 Digit Year]))
ORDER BY [Material Data].[GRD#];