>Hi, it's very easy to create a range of dates using CTEs...
>
>Here's an example....suppose I want to create a CTE of Saturday dates from 1-6-07 to 7-7-07...
>
>
>DECLARE @StartDate DATETIME, @EndDate DATETIME
>SET @StartDate = '1-6-2007'
>SET @EndDate = '7-7-2007'
>
>;WITH DateCTE(WeekEndingCTE) AS
>
> (SELECT @StartDate AS WeekEnding
> UNION ALL
>
> SELECT WeekEnding + 7 AS WeekEnding FROM WeekEndingCTE WHERE WeekEnding < @EndDate )
>
>
>
>
>That will give you a list of every Saturday date in that date range.
>
>(now, in JB's example, you'd add 1 day instead of 7, if you need every date in the range)
>
>Let me know if that helps...
>Kevin
I hope this could help to John, but this really helps to me.
Thank you.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.