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 |
alisag
Starting Member
5 Posts |
Posted - 2015-01-09 : 03:48:34
|
Hi Experts,A newbie here. So please be kind :-)I have 2 Tables namely Item & Item Entries. relation is Item.No = ItemEntries.No. In Item Entries Table I have Columns as Qty,Entry type,Purchase Amount,Sales AmountI like to have a report which Shows as Below,Item No. Opening Quantity Purcahse Amount Sales AmountTo calculate Opening Inventory I summed up the quantity field and the result is as expected. No problem in that. Now From that dataset i like to run a sub query which Calcualtes/Sum the Purchase amount for an Item that i sa part of first dataset and similarly for Sales Amount.e.g. Select(Item No.,Sum(IE.Quantity) As Quantity, Select(......Purchase Amount),Select(....Sales Amount)I hope i was able to clear my doubts to you guys. |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2015-01-09 : 07:17:30
|
Post some sample data of Items and ItemEntries tables and also the expected output for that data....It will be helpful to get quick responses....--Chandu |
|
|
|
|
|