我只需創建一個日程安排的項目和需要幫助..待辦事項而做在SQL Server
我有一個時間表數據
ID Programme Start End Division
----------------------------------------------------------
M001 Math 1/1/2017 20/01/2017 Math
M002 Aljabar 2/2/2017 20/02/2017 Math
E001 Conversation 3/1/2017 25/01/2017 English
E002 Vocabs 3/1/2017 20/02/2017 English
我需要使它看起來像這樣:
ID Date
------------------
M001 1/1/2017
M001 2/1/2017
M001 3/1/2017
so on until 20/1/2017
M002 2/2/2017
M002 3/2/2017
so on until 20/02/2017
E001 3/1/2017
E001 4/1/2017
so on until 25/01/2017
E002 3/1/2017
E002 4/1/2017
so on until 20/02/2017
感謝
做到這一點
搜索「SQL Server的擴大日期範圍」對飛日期的一種方式。這個問題已被問及答覆了一千次。其中一個結果:https://stackoverflow.com/questions/26910398/expand-from-to-date-columns-to-1-row-per-day-within-that-range – Alex
可能的重複[Expand「From 「&」要「在該範圍內將列每日排成1行)(https://stackoverflow.com/questions/26910398/expand-from-to-date-columns-to-1-row-per-day-within -that-range) – Alex