|
Hello I have a table"production" with fields of Date,Shift,Line,Item,Quantity, How can i get a result mentioned below.
parameters date1,date2
Heading1 Day1 day1 Day1 Day2 day2 Day2
Heading2 shift1 shift2 shift3 shift1 shift2 shift3
result Item1 Line&qty Line&qty Line&qty Line&qty Line&qty Line&qty
Item2 Line&qty Line&qty Line&qty Line&qty Line&qty Line&qty
Item3 Line&qty Line&qty Line&qty Line&qty Line&qty Line&qty
Item4 Line&qty Line&qty Line&qty Line&qty Line&qty Line&qty
Item5 Line&qty Line&qty Line&qty Line&qty Line&qty Line&qty
Item6 Line&qty Line&qty Line&qty Line&qty Line&qty Line&qty
Item7 Line&qty Line&qty Line&qty Line&qty Line&qty Line&qty
Please Help ME Thanks Andrew
(comments are locked)
|
|
With PIVOT, take a look at the following links.
(comments are locked)
|
|
It seems you want a dinamic table result set, in this way i would suggest using using "WITH CUBE" or "WITH ROLLUP". Anyway, try using a dynamic table or reporting services to return this query, it should be easier.
(comments are locked)
|
|
Sounds like you need something more than just a query. SSRS reports are fairly easy to create
(comments are locked)
|


Before we take a stab and guess the wrong way please let us know the datatypes for the production table. i.e. is Shift binary (0 or 1), numeric (1 or 2) or a character field ('Day', 'Night'). It will assist in coding.