• Hi and welcome to SSC. It is difficult to answer your question because there is not a lot of detail in the question. From your description I am pretty sure that you can accomplish this. You just need to find the text of the "previous" entry and replace that with ''.

    create table #SomeData

    (

    UserName varchar(20),

    EntryTime Time,

    FieldValue varchar(max)

    )

    insert #SomeData

    select 'Bob Hope', '12:00:00', 'We cannot do anything until 1 O''Clock - the penguin needs defrosting' union all

    select 'Rolf Harris', '13:00:00', 'We cannot do anything until 1 O''Clock - the penguin needs defrosting I have defrosted it' union all

    select 'Jeff Bridges', '13:13:00', 'We cannot do anything until 1 O''Clock - the penguin needs defrosting I have defrosted it It''s Alive!' union all

    select 'Jenny Bond', '13:46:25', 'We cannot do anything until 1 O''Clock - the penguin needs defrosting I have defrosted it It''s Alive! I let it go.'

    ;with cte as

    (

    select *, ROW_NUMBER()over(order by EntryTime) as RowNum

    from #SomeData

    )

    , cte2 as

    (

    SELECT UserName, EntryTime, c1.FieldValue as FieldValue1, c1.RowNum, (select c2.FieldValue from cte c2 where c2.RowNum = c1.RowNum - 1) as FieldValue2 FROM cte c1

    )

    select UserName, EntryTime, ltrim(isnull(REPLACE(FieldValue1, FieldValue2, ''), FieldValue1)) as NewValue from cte2

    drop table #SomeData

    Notice how I posted sample data and structures. This is something you should consider on future posts. You can view the first link in my signature for best practices when posting questions.

    --EDIT--

    LOL it seems that two others posted while I was writing my response. :hehe:

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/