Help with the query - creating multiple records for a date range

  • I have a table with 3 fields task , Start Date, End Date and data like below
    Task         StartDate  EndDate
    Task1       1/1/2017    1/1/2017
    Task2       1/1/2017    1/5/2017

    I want to write an query which will provide me results like

    Task         WorkDate  
    Task1       1/1/2017    
    Task2       1/1/2017    
    Task2       1/2/2017    
    Task2       1/3/2017    
    Task2       1/4/2017    
    Task2       1/5/2017

  • Try joining to a calendar table

    http://www.sqlservercentral.com/articles/calendar/145206/

    ____________________________________________________

    Deja View - The strange feeling that somewhere, sometime you've optimised this query before

    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537

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

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