• Awesome job posting consumable ddl and sample data!!!! I wish everyone would create posts like that. It really makes this easy to work with.

    I am not quite sure what you are looking for but this matches your posted desired output.

    select t.entity_id

    , t.effective_date

    , t.company_name

    , t.last_accounts_date

    , t2.s_code

    , t2.s_code_description

    , t2.ineffective_date

    from Tab1 t

    join tab2 t2 on t2.entity_id = t.entity_id

    _______________________________________________________________

    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/