• well i've only done one piece of it...adding the date;

    i have a simple macro i use to dump typical copy/paste data and turn it into a CTE, so coming up with SOMETHING feels better than skipping the question altogether. i try not to pad my post count asking for DDL and sample data too often ๐Ÿ˜›

    the second part i glossed over:

    there's a requirement for " whenever it find a โ€œ1โ€ in the pattern column. If there is a gap in the pattern it doesnโ€™t need to create a new row."

    can be done, but need more than one sample row, and need to know the length of string, whether the preceeding whitespace was relevant, and some more details, but this might get the ball rolling.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!