>I have two tables: Allocated and Product Lot Info
>
[quoted text clipped - 7 lines]
>
>How do I set up the query to do this?
Create a query joining [Product Lot Info] to [Allocated]; select the
join line and choose option 2 (or 3) - "Show all info in Product Lot
Info and matching records in Allocated".
Use an expression
[Product Lot Info].[Quantity] - NZ([Allocated].[Quantity])
The NZ() function will take the NULL (which will be created for
nonexistant records by the outer join) and convert it to a zero.
John W. Vinson[MVP]
Anna - 02 Aug 2005 15:01 GMT
> >I have two tables: Allocated and Product Lot Info
> >
[quoted text clipped - 20 lines]
>
> John W. Vinson[MVP]
How do I also have the query do as above but if product is allocated take
the difference from the Product Lot Info table and the sum of product
allocated by lot number?
John Vinson - 02 Aug 2005 23:30 GMT
>How do I also have the query do as above but if product is allocated take
>the difference from the Product Lot Info table and the sum of product
>allocated by lot number?
Create and save a Totals query based on the Allocated table, grouping
by [Lot Number] and summing the allocation; use this query in your
Join rather than the allocations table itself.
John W. Vinson[MVP]
Anna - 06 Aug 2005 05:28 GMT
> >How do I also have the query do as above but if product is allocated take
> >the difference from the Product Lot Info table and the sum of product
[quoted text clipped - 5 lines]
>
> John W. Vinson[MVP]
Thanks John it worked perfectly.