I have the query below which returns 2 records. One of the records is for 1 case and the other for 2 cases. I need the record for 2 cases broken into 2 rows each for one case
currect outeput of the query (above)
Desired output. I need one record for each CS for item 3125-05.
I need each item that has a qty grated than 1 to be broken down into a record for each case so if the qty = 5 then I would need 5 records each for 1 CS.
Any help is appreciated
Thanks
RJL
Code:
SELECT
-----------------------------------------------------------
WI.REFERENCE_ID,
WI.ITEM,
WI.CONVERTED_QTY AS 'QTY',
WI.CONVERTED_QTY_UM AS 'UOM',
WI.FROM_LOC
-----------------------------------------------------------
FROM
WORK_INSTRUCTION WI WITH(NOLOCK)
-----------------------------------------------------------
WHERE
WI.INSTRUCTION_TYPE = 'DETAIL' AND
WI.INTERNAL_NUM = 118835
currect outeput of the query (above)
Code:
REFERENCE ID ITEM QTY UOM FROM LOCATION
------------ ----- ---- --- -------------
TEST0000001 3125-05 2 CS 001-006-AB-03
TEST0000001 6255-01 1 CS 006-029
Desired output. I need one record for each CS for item 3125-05.
Code:
REFERENCE ID ITEM QTY UOM FROM LOCATION
------------ ----- ---- --- -------------
TEST0000001 3125-05 1 CS 001-006-AB-03
TEST0000001 3125-05 1 CS 001-006-AB-03
TEST0000001 6255-01 1 CS 006-029
I need each item that has a qty grated than 1 to be broken down into a record for each case so if the qty = 5 then I would need 5 records each for 1 CS.
Any help is appreciated
Thanks
RJL