By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,256 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

Creating (not selecting) a range of dates

P: n/a
Hi,

Not sure if this would be possible without using vba or similar programming,
but can I use sql to create a column of dates in a regular sequence (such as
weekly, monthly etc.)

I would like the results to be e.g.

date
01/01/04
08/01/04
15/01/04
22/01/04
29/01/04
Many thanks,
Chris
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Tue, 20 Apr 2004 10:00:26 +0100, "Not Me"
<No****@faker.fake.fa.kee> wrote:

No.
You would need to use a few lines of VBA, likely using a loop and the
DateAdd function. The INSERT statement you're creating in the loop
could be executed using the Execute method. Or alternatively you could
call a parameterized Append query.

-Tom.
Hi,

Not sure if this would be possible without using vba or similar programming,
but can I use sql to create a column of dates in a regular sequence (such as
weekly, monthly etc.)

I would like the results to be e.g.

date
01/01/04
08/01/04
15/01/04
22/01/04
29/01/04
Many thanks,
Chris


Nov 12 '05 #2

P: n/a
CDB
SELECT DateAdd("d",Date(),7*([Ones_1].[Digit]*10+[Ones].[Digit])) AS A
FROM Ones, Ones AS Ones_1
ORDER BY DateAdd("d",Date(),7*([Ones_1].[Digit]*10+[Ones].[Digit]));

Table Ones holds digits 0 to 9 - 10 rows. Use Where clause to limit range.

Clive
"Not Me" <No****@faker.fake.fa.kee> wrote in message
news:c6**********@ucsnew1.ncl.ac.uk...
Hi,

Not sure if this would be possible without using vba or similar programming, but can I use sql to create a column of dates in a regular sequence (such as weekly, monthly etc.)

I would like the results to be e.g.

date
01/01/04
08/01/04
15/01/04
22/01/04
29/01/04
Many thanks,
Chris

Nov 12 '05 #3

P: n/a
"CDB" <al***@delete.wave.co.nz> wrote in message
news:c6**********@news.wave.co.nz...
SELECT DateAdd("d",Date(),7*([Ones_1].[Digit]*10+[Ones].[Digit])) AS A
FROM Ones, Ones AS Ones_1
ORDER BY DateAdd("d",Date(),7*([Ones_1].[Digit]*10+[Ones].[Digit]));

Table Ones holds digits 0 to 9 - 10 rows. Use Where clause to limit range.


Works great!

Cheers,
Chris
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.