Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Get data from Previous record (Cumulative Data)-- Urgent help required RE: Get data from Previous record (Cumulative Data)-- Urgent help required

  • By DDL and sample data, we mean you need to post something like this so people helping can have a table on their system to work with.

    create table #test

    (

    mydatevarchar(6),

    prj_idint,

    amountnumeric(5)

    )

    insert #test

    select 'Jan12', 1, 1000

    union all select 'Feb12', 1, 1500

    union all select 'Apr12', 1, 1800

    union all select 'July12', 1, 1200

    union all select 'Jan12', 2, 500

    union all select 'Apr12', 2, 1000

    Besides being potentially tedious work for the helper, they may not be able to give you correct help if they guess incorrectly as to what data types your columns are.