J
Joe
Hello everyone -
I have a query that queries our Customer Orders & Shipping tables. This
query returns data for all shipped customer orders. I have a slight
problem however. When our shipping department ships an order, sometimes
they ship it in multiple packages at different times of the day. When
they enter this into our system, it appears as different shipments.
For example, if a customer orders 100 pieces our shipping department
might ship 50 pieces in the morning, 25 pieces in the afternoon, and 25
pieces before closing. This then appears in 3 rows in my query.
Example:
Order ID: Order Qty: Ship Qty:
139756 100 25
139756 100 25
139756 100 50
My question is - how can I have my query combine these into one record
by checking to see if the sum of the Ship Qty rows is equal the first
rows Order Qty.
Basically, how can I have my query say If the sum of the Ship Qty
(25+25+50) = Order Qty (100) combine into one record return as:
Order ID: Order Qty: Ship Qty:
139756 100 100
If the sum of the ship quantities does not = the order quantity it is
fine if it breaks up into multiple rows because we want to identify
missed shipments.
Thanks for all your help.
I have a query that queries our Customer Orders & Shipping tables. This
query returns data for all shipped customer orders. I have a slight
problem however. When our shipping department ships an order, sometimes
they ship it in multiple packages at different times of the day. When
they enter this into our system, it appears as different shipments.
For example, if a customer orders 100 pieces our shipping department
might ship 50 pieces in the morning, 25 pieces in the afternoon, and 25
pieces before closing. This then appears in 3 rows in my query.
Example:
Order ID: Order Qty: Ship Qty:
139756 100 25
139756 100 25
139756 100 50
My question is - how can I have my query combine these into one record
by checking to see if the sum of the Ship Qty rows is equal the first
rows Order Qty.
Basically, how can I have my query say If the sum of the Ship Qty
(25+25+50) = Order Qty (100) combine into one record return as:
Order ID: Order Qty: Ship Qty:
139756 100 100
If the sum of the ship quantities does not = the order quantity it is
fine if it breaks up into multiple rows because we want to identify
missed shipments.
Thanks for all your help.