your query says "get all the rates in the rate details table, but only if a whole bunch of rows are all connected to something called Run Key 2, otherwise don't return anything at all"
that can't be right
i might be able to help you if you will follow along with me and build up your query one step at a time
you said "when a shipment goes out I need to find ..."
so let's start with a query that gets the particular shipment you're dealing with
Code:
select foo, bar
from shipments
where shipments.id = ?
is this at all close to what you're doing?