R
RocketDude
Hi,
I'm having a problem combining the "LEFT JOIN" SQL method and mathematical
operations (in this case subtraction). My problem is that I am trying to
subtract monthly sales data from two tables, where my left table has some
data that my right table does not, and wherever the data is missing from the
right table, Access sets the resulting subtraction to "Blank". Where it
should be just the value in the left table.
For example, assume I have two tables Company, DivisionA, and I want to find
out what the monthly sales by product are for the Company, not including the
monthly sales for DivisionA (In essences I want to see what Company -
DivisionA is by product by month). And further assume that the Company table
contains some products (rows) that are not in the DivisionA table. Right
now, my SQL looks like:
SELECT Company.Distributor, Company.Product, ([Company]![Jan02] -
[DivisionA]![Jan02]) AS Jan02
INTO TableA
FROM Company LEFT JOIN Division ON (Company.Distributor =
DivisionA.Distributor) AND (Company.Product = DivisionA.Product)
How do I get Access to set "([Company]![Jan02] - [DivisionA]![Jan02]) " =
"([Company]![Jan02] " when " [DivisionA]![Jan02]" doesn't exist?
TIA,
I'm having a problem combining the "LEFT JOIN" SQL method and mathematical
operations (in this case subtraction). My problem is that I am trying to
subtract monthly sales data from two tables, where my left table has some
data that my right table does not, and wherever the data is missing from the
right table, Access sets the resulting subtraction to "Blank". Where it
should be just the value in the left table.
For example, assume I have two tables Company, DivisionA, and I want to find
out what the monthly sales by product are for the Company, not including the
monthly sales for DivisionA (In essences I want to see what Company -
DivisionA is by product by month). And further assume that the Company table
contains some products (rows) that are not in the DivisionA table. Right
now, my SQL looks like:
SELECT Company.Distributor, Company.Product, ([Company]![Jan02] -
[DivisionA]![Jan02]) AS Jan02
INTO TableA
FROM Company LEFT JOIN Division ON (Company.Distributor =
DivisionA.Distributor) AND (Company.Product = DivisionA.Product)
How do I get Access to set "([Company]![Jan02] - [DivisionA]![Jan02]) " =
"([Company]![Jan02] " when " [DivisionA]![Jan02]" doesn't exist?
TIA,