I need some help formulating a query. Here is the table structure:
Package Components
PackageComponentID
RequestID
ProjectID
ItemID
Quantity
Each record in the table will either have a RequestID or a ProjectID, but never both. I want to get the sum of the quantity for each item and separated by RequestID and ProjectID, and have them in the same row. Example of some rows I want returned:
SampleItem1, SUM of Quantity that have RequestID, SUM of Quantity that have ProjectID
SampleItem2, SUM of Quantity that have RequestID, SUM of Quantity that have ProjectID
Can anyone help me out here? I can't seem to get this to happen in the same row, this is all I can get:
SampleItem1, SUM of Quantity that have RequestID
SampleItem1, SUM of Quantity that have ProjectID
SampleItem2, SUM of Quantity that have RequestID
SampleItem2, SUM of Quantity that have ProjectID
Thanks!
Patrick
Package Components
PackageComponentID
RequestID
ProjectID
ItemID
Quantity
Each record in the table will either have a RequestID or a ProjectID, but never both. I want to get the sum of the quantity for each item and separated by RequestID and ProjectID, and have them in the same row. Example of some rows I want returned:
SampleItem1, SUM of Quantity that have RequestID, SUM of Quantity that have ProjectID
SampleItem2, SUM of Quantity that have RequestID, SUM of Quantity that have ProjectID
Can anyone help me out here? I can't seem to get this to happen in the same row, this is all I can get:
SampleItem1, SUM of Quantity that have RequestID
SampleItem1, SUM of Quantity that have ProjectID
SampleItem2, SUM of Quantity that have RequestID
SampleItem2, SUM of Quantity that have ProjectID
Thanks!
Patrick