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 |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-12-18 : 08:25:29
|
fereja writes "Realy bad problem Table1GoodReceive------------Date Recive_no Item Qnt Item_Cost1/1/2006 R-001 Soap 10 40 1/2/2006 R-002 Soap 15 451/2/2006 R-003 shampo 45 551/3/2006 R-004 soap 35 50 Table 2GoodSold--------------Date Sold_no Item Qnt1/2/2006 S-001 Soap 81/4/2006 S-002 Soap 101/5/2006 S-003 Samop 30 I need a qurey like --------------------------------Date Item Recive_No QntRecive Itemcost Total_Cost Sold_No Qnt_Sold SoldValue Remain_Qnt Remain_Value1/1/2006 soap R-001 10 40 400 - - - 10 400 1/2/2006 soap R-002 15 45 675 - - - 25 10751/2/2006 soap - S-001 8 344 17 7311/3/2006 soap R-004 35 50 1750 - - - 52 24811/4/2006 soap - - - - S-002 30 1431.35 22 1049.65 N.BSoldValue = previous remain_value/Previous remain_qnt" |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-18 : 08:30:44
|
Where are the values {1431.35, 1049.65} fetched from?Peter LarssonHelsingborg, Sweden |
 |
|
fereja
Starting Member
2 Posts |
Posted - 2006-12-19 : 07:54:54
|
the value 1431.35 the previous row which is (2481/52) * 30 the value 1049.65 comes from the previous record 1049.65 - 1431.35 if is recive value it will added if is sold value it will subtructN.Bpleas refer Item costing report on peachtree and pleas help me |
 |
|
|
|
|