June 14, 2005 at 11:46 am
Hello I need to make a query to calculate shipping costs depending on ; * weight & destination * in the weight there are to tables, one below 25 kg's and one higher then 25kg's. The costs also depents on the country of destination
Can someone help me ?
June 14, 2005 at 11:52 am
Can you post the table definition, some sample data and the desired results from that data?
June 15, 2005 at 7:03 am
The table def is certainly needed...but here's something for you to play around with...
select cost =
case
when weight 25 and destination = 'Kenya' then weight * 6.2
when weight > 25 and destination = 'Canada' then weight * 3.2
end
from table
My 2 cents:I think you should just have a computed column do this for you
**ASCII stupid question, get a stupid ANSI !!!**
June 15, 2005 at 8:16 am
I'd go farther in that statement, make a function that returns the computed column. So you can reuse the logic somewhere else.
But if you want more help, I defenitly suggest you provide more information.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply