You could:
1) Create a temp table with a column to hold month names
2) Use GetDate() to put the current date in a local variable
3) Use another variable as a counter from 1 to 10 for a While loop
4) Inside the loop, perform an insert into the temp table using DateAdd and
the current date, along with the loop variable to specify how many months to
add
5) Select * from the temp table

> [...] I mean to get a Recordset list of the months
> from the current month to 10 month forward
>> Can I get 10 months forward with select statment without using the
>>database table.

02-20-2001, 08:43 AM

rLyra

Re: Get 10 months forward with select statment

"Nirit Touboul" <nirit@para-data.com> wrote:
>
>
>Thank you for your answer but I mean to get a Recordset list of the months
>from the current month to 10 month forward
>
I don`t have a SQL help Reference here, so I don`t remember the sintax of
this commands, you need to find it.

1 - you need a "list of the months". This will be a list of year and month,
ok ? So you need a function to extract year and month from a date.

2 - You also need that dateadd funcion sintax, because I don`t remember.