Cascading data from one returned row to the next

  • Hi,

    Can anyone one suggest an easy way of cascading certain fields from one returned record to the next until the data changes.

    i.e.

    Select *

    from Table

    returns

    Date Status Record Type

    01/02/2014 04 West

    02/02/2014 04

    03/02/2014 06

    04/02/2014 04 East

    07/03/2014 07 North

    04/04/2014 09

    etc

    What I want is

    Date Status Record Type

    01/02/2014 04 West

    02/02/2014 04 West

    03/02/2014 06 West

    04/02/2014 04 East

    07/03/2014 07 North

    04/04/2014 09 North

    The record Type on the end is cascaded down to the blank fields.

    I need to write the SQL code in the simplest of terms, because it needs to be used and understandable by novice coders.

  • Tables have no order. Is there any field in your table that can be sorted on to ensure the rows have the correct order?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply