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 |
|
DENIZ3E
Yak Posting Veteran
56 Posts |
Posted - 2005-12-02 : 17:16:01
|
| HI,I have got a table.table----------------------------linenr stockref linetype total sale rate NAME------- -------------- -------------- ----------- --------- ---------0 0 SALE 100 1,4 A0 0 SALE 200 2 B1 34 normal 400 0 2 0 SALE 100 1,6 C3 0 SALE 150 5,6 D4 0 SALE 200 7 E5 45 normal 500 06 0 SALE 150 10 C8 0 SALE 100 11,5 D9 0 SALE 150 10 EThis table is an example of an INVOICE. I WANT TO returnsStockref TOTAL A B C D E------------ --------- ---------- -------- ------- ------------ ----------34 400 400*1.4 400*2 400*1.6 400*5.6 400*745 500 500*1.4 500*2 500*10 500*11.5 500*10400= price of stock number 34 |
|
|
nosepicker
Constraint Violating Yak Guru
366 Posts |
Posted - 2005-12-02 : 21:43:57
|
| You need to explain your business logic more clearly. How are we supposed to know which rate to apply to the totals? For example, how does one know that the rate of 7 is supposed to be used for "E" for stock #34 and a different rate of 10 is used for stock #45? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|