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

  • Motz (5/3/2013)


    The first records set is the table data which is cumulative data, but i need to populate the data for the missing dates as well and insert new record set in another table.

    Unless you need this data to persist you don't need to insert this to another table. You can use a tally table.

    I am willing and able to help but I need you to first help me by posting ddl (create table scripts) and some sample data (insert statements). Once you post that I can show you how you can easily do this with a tally table.

    _______________________________________________________________

    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/