DECLARE @StartDate DATETIME
SET @StartDate = '02/26/1988'
DECLARE @EndDate DATETIME
SET @EndDate = '03/01/1988'
DECLARE @TableOfDates TABLE(DateValue DATETIME)
DECLARE @CurrentDate DATETIME
SET @CurrentDate = @startDate
WHILE @CurrentDate <= @endDate
BEGIN
INSERT
INTO @TableOfDates(DateValue) VALUES (@CurrentDate)
SET
@CurrentDate = DATEADD(DAY, 1, @CurrentDate)
END
SELECT * FROM
@TableOfDates
No comments:
Post a Comment