September 10, 2013 at 9:39 am
SELECT CONVERT(varchar,C.SCHED_DTTM,101) as DATE,C.INV_ITEM_ID ,SUM(C.QTY_REQUESTED) AS QTY
FROM PS_IN_DEMAND C WHERE C.SCHED_DTTM>=GETDATE() AND C.IN_FULFILL_STATE IN (10,20,30,40)
GROUP BY C.SCHED_DTTM,C.INV_ITEM_ID
ORDER BY C.SCHED_DTTM,C.INV_ITEM_ID
[p]DATEINV_ITEM_IDQTY
9/10/2013W526R2
9/10/2013X426R1
9/10/201364143
9/11/20132001-14
9/11/20132001-24
9/11/20132001-54
9/11/201310-1109R1
9/12/2013124011
9/12/2013124021
9/12/2013124051
9/12/2013124061
9/12/2013124331
9/12/201338011
[/p]
September 10, 2013 at 9:43 am
You're not giving enough information.
We would be happy to help but we need you to be more explicit on what you need.
Please post the DDL for your tables and sample data in the form of INSERT statements, as well as the expected results based on that sample data.
September 11, 2013 at 7:33 am
Take a look at the Cross Tab and Pivot links in my signature. I think they'll give you what you need.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply