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 |
|
tecknowledge1164
Starting Member
25 Posts |
Posted - 2006-04-18 : 15:57:28
|
| I have a report that is based on a SQL statement as follows: SELECT Category, ItemNumber, ItemCost, SumOfQuantity, Description, (SumOfQuantity * ItemCost) AS Total FROM viwInventory WHERE Category Like [ComboBoxSelection] ORDER BY Category. I need to add three columns to each row in the report, all summing the Quantity field of a table WHTransactions where the Type = 1, 2, and 3, i.e. Sum(Quantity) as Received where Type = 1, Sum(Quantity) as BeginningBalance where Type = 2, Sum(Quantity) as Shipped where Type = 3. The join field is viwInventory.ID = WHTransactions.WHInventoryID.I am not sure how to construct the SQL statement to accomplish this. I can't really change the view that the report uses since it is used in other places, so I will need to modify the SQL in the report. Any suggestions would be appreciated.TIABob Thompson |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2006-04-18 : 16:13:17
|
| Read the section on CROSSTAB reports in Books Online. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
tecknowledge1164
Starting Member
25 Posts |
Posted - 2006-04-19 : 14:52:22
|
quote: Originally posted by blindman Read the section on CROSSTAB reports in Books Online.
That was all it took, many thanks.Bob |
 |
|
|
|
|
|
|
|