Hi I am new to SQL server 2008
I want to expand a single row to multiple rows based on another colomn,
e.g
date value
7-2011 5
Results:
2011-07-01
2011-08-01
2011-09-01
2011-10-01
2012-11-01
the date shoild be first day of current and next month repeated 5 times
try:
output:
it works with multiple rows in the table, see here:
OUTPUT:
Also, I don’t have SQL Server 2008 available, so I used datetime, if you have 2008, you can use
DATEdatatype and you don’t have to floor the datetime, so use this line: