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 |
|
jamez36
Starting Member
3 Posts |
Posted - 2006-01-19 : 18:53:12
|
| I need to get the sum of I.QtyRcvd and have that value returned for each matching record, right now it only returns the record that has values for I.QtyRcvd <> 0.SQL = "SELECT P.Quantity as Qty, " & vbCrLf _ & "P.ItemID, " & vbCrLf _ & "P.VendorCode, " & vbCrLf _ & "P.Descr as Description, " & vbCrLf _ & "P.UnitPrice as Price, " & vbCrLf _ & "Amount = 0.0, " & vbCrLf _ & "Freight = 0.0, " & vbCrLf _ & "Rcvd = 0, " & vbCrLf _ & "sum(I.QtyRcvd) as Ship" & vbCrLf _ & "FROM PurchaseOrderItems P, ReceivedItems I, Received R" & vbCrLf _ & "WHERE I.ItemID = P.ItemID AND P.POID = R.POID AND R.IntRcdID = I.PRID AND P.POID = " & txtPO.Text & vbCrLf _ & "GROUP BY P.Quantity, P.ItemID, P.VendorCode, P.Descr, P.UnitPrice" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-01-20 : 00:25:00
|
| Post some sample data and the result you wantMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|