Saturday, February 25, 2012

Dates Result Set

Hi, All,
I need a single result set that just returns today's date
plus 6 more days. I want to do this without a cursor.
Any ideas?
Thanks!
T
Here is one solution:
select cast(convert(char(8),getdate(),112) as datetime) + i as d
from (
select 0 as i union all select 1 union all select 2 union all select 3
union all select 4 union all select 5 union all select 6
) T
Steve Kass
Drew University
tom sawyer wrote:

>Hi, All,
>I need a single result set that just returns today's date
>plus 6 more days. I want to do this without a cursor.
>Any ideas?
>Thanks!
>T
>

No comments:

Post a Comment