How to repeat the row values up to end date
For Example
Table1
Date Name Dept
-----------------------
12-02-2009 Raja IT
13-02-2009 Ravi CSE
14-02-2009 Ramu ECE
From the above table value i want to repeat the value between the two dates from 12-02-2009 to 12-03-2009.
Expected Output
Date Name Dept
--------------------------
12-02-2009 Raja IT
13-02-2009 Ravi CSE
14-02-2009 Ramu ECE
15-02-2009 Raja IT
16-02-2009 Ravi CSE
17-02-2009 Ramu ECE
18-02-2009 Raja IT
19-02-2009 Ravi CSE
20-02-2009 Ramu ECE
...
...
12-03-2009
How to make a query for repeating the row values upto end date or is possible in vb.net by using while loop like
code
select max(date) from table
while max(date) < End Date
'Repeat the row values
end while
My Table Structue
Date Name Dept Time
12-02-2009 Raja IT 09:00
13-02-2009 Ravi CSE 18:00
14-02-2009 Ramu ECE 10:00
Expected Output
Date Name Dept Time StartDate EndDate
12-02-2009 Raja IT 09:00 12-02-2009 12-02-2009
13-02-2009 Ravi CSE 18:00 13-02-2009 14-02-2009
14-02-2009 Ramu ECE 10:00 14-02-2009 14-02-2009
...,
If StartDate is same value of Date column For EndDate i have to check the time column, if time is greater than 17:00 it should display a next date in EndDate column.
Need SQL Query or VB.Net Code Help