calculate shipping price

  • 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 ?

  • Can you post the table definition, some sample data and the desired results from that data?

  • 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 !!!**

  • 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