Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
josh777
Starting Member
12 Posts |
Posted - 2007-03-20 : 16:43:59
|
| I need some help with this query .There are two tables ItemDetails, FreightItem details has Item,Quantity,UnitPriceFreight has Freightcharges and other columnsBases on different unit prices i have to set the FreightWith a single query i want to set the freightcharges in the freight table based on the unitprice in the Itemdetails tableselect UnitPrice,Quantity,Freightcharge =Case when temDetails.UnitPrice between 0 and 500 then quantity*15 when ItemDetails.UnitPrice between 500 and 1000 then quantity*20 when ItemDetails.UnitPrice between 1000 and 2000 then quantity*25 when ItemDetails.UnitPrice > 2000 then quantity*30elsenullend from ItemDetailsi want this freightcharge to be assigned directly to the Freight table. Thank you for your help.regards,josh |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-20 : 21:44:52
|
what is the relationship between Freight and ItemDetails ? KH |
 |
|
|
josh777
Starting Member
12 Posts |
Posted - 2007-03-21 : 14:47:48
|
| The relation between freight and Item details is that they have same items. Freight is the additional expense for a item.Freight.item ,Itemdetails.Item. |
 |
|
|
|
|
|