MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 10th, 2004, 01:05 PM
Jacque Jacque is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 3 Jacque User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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?

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Complex query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT