Hi thereHere is some code that will do it (you can add it into your procedure as you see fit)Create Table #temp ( thedate datetime)Declare @StartDate datetime, @EndDate datetimeSelect @StartDate = '1-oct-2002', @EndDate = '5-Nov-2002'SET NOCOUNT ONDeclare @NoDays int, @i intSet @NoDays = DateDiff(d, @StartDate, @EndDate)Set @i = 0While @i <= @NoDays Begin Insert Into #Temp Values (DateAdd(d, @i , @StartDate)) Set @i = @i + 1EndSET NOCOUNT OFFSelect * from #temp Drop Table #temp
Hope that helpsDamian