
December 10th, 2004, 01:05 PM
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Complex query
Here is the query that I have so far. I need to build on this and I need some help.
Code:
SELECT AdditionalRate, AreaCharge FROM WEB_ADDRATE WHERE CarrierCode= 'UPS' AND CarrierServiceCode= '01'
The AdditionalRate and AreaCharge will depend on the Country and State.
Here is a small output of the WEB_ADDRATE table. Sorry about the formatting.
Code:
CarrierCode CarrierServiceCode CountryCode State AdditionalWeight AreaCharge
UPS 1 2 0
UPS 1 US HI 2.5 5
UPS 1 US AK 2.5 5
If the CountryCode is not listed or the State code is not listed then it will take the amounts where the Country is NULL or State is NULL. I just don't know how to complete this query. I would rather do it in the query than a couple of for...next loops and if statements.
Any suggestions?
|