I found out that I can solve the first problem by using the UNION ALL command.
That leaves only the second question...
Regards,
Why do you have two different tables for shipped pallets and cartons?

Signature
www.ae911truth.org
> I found out that I can solve the first problem by using the UNION ALL command.
>
[quoted text clipped - 59 lines]
> >
> > Nasko
Nasko - 31 Jul 2007 13:40 GMT
To be honoust, this is only an example.
using the real data, one table coming direclty from the client shows the
cartons that are shipped directly and another table gives the cartons that
need extra handling before being shipped. They dont have the same format so I
cannot ´union´ them. I made this example to better explain the problem I
have. (The pallet field came into the example because I have to calculate
everything in pallets at the end...)
Regards,
> Why do you have two different tables for shipped pallets and cartons?
>
[quoted text clipped - 61 lines]
> > >
> > > Nasko
scubadiver - 31 Jul 2007 13:52 GMT
The only suggestion I can make is if you design a query and show the two
tables. Insert the following fields
ShippedCartons.ProductCode
ShippedCartons.SumOfCartons
ShippedPallets.ProductCode (Insert a criteria here:
[shippedcartons].[productcode])
ShippedPallets.SumOfPallets
Hopefully you will then get this:
ProductCode NrShippedCartons ProductCode NrShippedCartons
1234 10 1234 2
1234 15 1234 4
2345 10 2345 1
Then you can make the second "ProductCode" column invisible and base a
totals query on this.
The alternative is to create a join between the two product codes in the top
pane of the query and then you should get the same result.

Signature
www.ae911truth.org
> To be honoust, this is only an example.
>
[quoted text clipped - 72 lines]
> > > >
> > > > Nasko
Nasko - 31 Jul 2007 13:42 GMT
The exact querry. I also have a problem that the sum total pallets is only
calculated when there is copacking for a certain ProductCode.
SELECT ProductCodes.ProductCode,
AllOut.ShippedCartonNr,
AllOut.ShippedInners,
AllOut.ShippedCartonNr Mod ProductCodes.CartonsPerpallet AS
LooseCartons,
ProductCodes.CartonsPerPallet,
AllOut.ShippedCartonNr\ProductCodes.CartonsPerpallet AS FullPallets,
[LooseCartons]/ProductCodes.CartonsPerPallet AS PickedPallets,
AllOut.ShippedInners/ProductCodes.InnersPerCarton/productCodes.CartonsPerPallet AS InnerPallets,
[CopackAll].[ShippedCartonNr]/[ProductCodes].[CartonsPerPallet] AS
CopackPallets,
[FullPallets]+[PickedPallets]+[Innerpallets]+[CopackPallets] AS
TotalPallets
FROM (ProductCodes LEFT JOIN AllOut ON ProductCodes.ProductCode =
AllOut.ProductCode) LEFT JOIN CopackAll ON ProductCodes.ProductCode =
CopackAll.ProductCode;
> Why do you have two different tables for shipped pallets and cartons?
>
[quoted text clipped - 61 lines]
> > >
> > > Nasko