SJR19 Posted May 27, 2015 Share Posted May 27, 2015 (edited) Ok my query gives me these results. BatchID | Batch_Item_Count ------------------------------------------- 1514021901 | 12 I need results to look like this BatchID I Batch_Item_Count ------------------------------------------ 1514021901 | 0001514021901 I 0011514021901 I 0021514021901 | 0031514021901 | 0041514021901 | 0051514021901 | 0061514021901 | 007 1514021901 | 0081514021901 | 0091514021901 | 0101514021901 | 011 I hope this is a OK example. I trying to duplicate a row that in table for a batch that was created the batch has 12 items in it. I need to label these 12 items. So I need the BatchID to stay the same and for the row to be duplicated 12 times and format the batch_Item_Count like this 000 through to 011. The max amount of items that can be batches in 999. I need this to work for any amount of items in a batch from 1 to 999. Edited May 27, 2015 by SJR19 Link to comment Share on other sites More sharing options...
justsomeguy Posted May 27, 2015 Share Posted May 27, 2015 I'm not sure if a basic query will let you create a result like that, you might need to use a stored procedure to build that by inserting a bunch of rows into a temporary table and then selecting everything from the table. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now