Hi all - am struggling a bit here... Am using reporting services and have created a despatch note which uses a stored proc as the datasource. All working fine :) However, now the client wants an extra field called "to follow" for any items on the current despatch note which has items outstanding (not on any despatch notes).To try and explain further, a customer orders 100 televisions. I have despatched 10 and 20 on seperate notes. I am now despatching 50. The "to follow" amount should be "20". This is the proc I am currently using:SELECT despatch.despatchid, despatch.orderid, despatch.address1, despatch.address2, despatch.address3, despatch.address4, despatch.address5, despatch.postcode, orders.clientorderno, despatch.datedespatched, clients.accountno, despatch.deliverycontact, despatch.specialinstructions, despatchline.qty, despatchline.description, products.productcodeFROM despatch INNER JOIN orders ON despatch.orderid = orders.orderid INNER JOIN clients ON orders.clientid = clients.clientid INNER JOIN despatchline ON despatch.despatchid = despatchline.despatchid LEFT OUTER JOIN products ON despatchline.productid = products.productidWHERE (despatch.despatchid = @despatchid)
Any help greatly appreciated.Steve.