N
Nasko
I hope you can help me with the next problems I have:
Question 1: Merge two tables
I have a table with shipped cartons in peak and average month
ShippedAverage
ShippedPeak
I like to have a querry combining both tables like
SELECT * FROM ShippedAverage
AND
SELECT * FROM ShippedPeak
Is this possible? How can I do this in the design view?
Question 2: Group problem
I have two different types of shipping tables
ShippedCartons, with fields
ProductCode, NrShippedCartons
1234 10
1234 15
2345 10
And ShippedPallets
ProductCode, NrShippedPallets
1234 2
1234 4
2345 1
I like to have a summary of both
SELECT ProductInfo.ProductCode,
sum(ShippedCartons.NrShippedCartons),
sum(ShippedPallets.NrShippedPallets)
WHERE productInfo.ProductCode = ShippedCartons.ProductCode
AND productInfo.ProductCode = ShippedPallets.ProductCode
GROUP BY productInfo.ProductCode
To get next info
ProductCode SumOfCartons SumOfPallets
1234 25 6
2345 10 1
But the values are higher, probably because he selects too much records for
the sum (double records?).
How do I solve this?
Thanks in advance again!!
Regards,
Nasko
Question 1: Merge two tables
I have a table with shipped cartons in peak and average month
ShippedAverage
ShippedPeak
I like to have a querry combining both tables like
SELECT * FROM ShippedAverage
AND
SELECT * FROM ShippedPeak
Is this possible? How can I do this in the design view?
Question 2: Group problem
I have two different types of shipping tables
ShippedCartons, with fields
ProductCode, NrShippedCartons
1234 10
1234 15
2345 10
And ShippedPallets
ProductCode, NrShippedPallets
1234 2
1234 4
2345 1
I like to have a summary of both
SELECT ProductInfo.ProductCode,
sum(ShippedCartons.NrShippedCartons),
sum(ShippedPallets.NrShippedPallets)
WHERE productInfo.ProductCode = ShippedCartons.ProductCode
AND productInfo.ProductCode = ShippedPallets.ProductCode
GROUP BY productInfo.ProductCode
To get next info
ProductCode SumOfCartons SumOfPallets
1234 25 6
2345 10 1
But the values are higher, probably because he selects too much records for
the sum (double records?).
How do I solve this?
Thanks in advance again!!
Regards,
Nasko