The CarrierTbl is straightforward, ‘SELECT * FROM CARRIERTBL’

You will need filters for the CarrierZone_Tbl @Zone, @CountryCode, @CarrierID and depending on which has been chosen one of these three statements (or a combination)
SELECT CarrierTbl.Carrier, CarrierZoneTbl.Zone, Country_Tbl.Country
FROM Carrier_Tbl INNER JOIN
CarrierZoneTbl ON CarrierTbl.CarrierID = CarrierZone_Tbl.CarrierID INNER JOIN
CountryTbl ON CarrierZoneTbl.CountryCode = CountryTbl.CountryCode WHERE CarrierZoneTbl.Zone =@Zone

SELECT CarrierTbl.Carrier, CarrierZoneTbl.Zone, Country_Tbl.Country
FROM Carrier_Tbl INNER JOIN
CarrierZoneTbl ON CarrierTbl.CarrierID = CarrierZone_Tbl.CarrierID INNER JOIN
CountryTbl ON CarrierZoneTbl.CountryCode = CountryTbl.CountryCode WHERE CarrierZoneTbl.CountryCode =@CountryCode

SELECT CarrierTbl.Carrier, CarrierZoneTbl.Zone, Country_Tbl.Country
FROM Carrier_Tbl INNER JOIN
CarrierZoneTbl ON CarrierTbl.CarrierID = CarrierZone_Tbl.CarrierID INNER JOIN
CountryTbl ON CarrierZoneTbl.CountryCode = CountryTbl.CountryCode WHERE CarrierTbl.CarrierID =@CarrierID

You will also need filters for the CarrierPrice_Tbl, @Zone and @CarrierID.

SELECT CarrierTbl.Carrier, CarrierPriceTbl.Zone, CarrierPriceTbl.MaxWeight, CarrierPriceTbl.Price, WeightMultiplier_Tbl.WeightMultiplier
FROM CarrierPrice_Tbl INNER JOIN
CarrierTbl ON CarrierPriceTbl.CarrierID = Carrier_Tbl.CarrierID INNER JOIN
WeightMultiplierTbl ON CarrierPriceTbl.WeightMultiplierID = WeightMultiplierTbl.WeightMultiplierID WHERE CarrierPriceTbl.Zone=@Zone

SELECT CarrierTbl.Carrier, CarrierPriceTbl.Zone, CarrierPriceTbl.MaxWeight, CarrierPriceTbl.Price, WeightMultiplier_Tbl.WeightMultiplier
FROM CarrierPrice_Tbl INNER JOIN
CarrierTbl ON CarrierPriceTbl.CarrierID = Carrier_Tbl.CarrierID INNER JOIN
WeightMultiplierTbl ON CarrierPriceTbl.WeightMultiplierID = WeightMultiplierTbl.WeightMultiplierID WHERE CarrierPriceTbl. CarrierID =@ CarrierID

Last edited Mar 19, 2012 at 9:47 AM by robinz1001, version 1

Comments

No comments yet.