473,513 Members | 2,559 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating (not selecting) a range of dates

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
3 1498
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3338
by: Jeff Roe | last post by:
I need to do a search in MySql for birth date range. (i.e. for birth date >= 01/23/65 and <=12/31/03.) Any suggestions on how to do this select? Thanks!
1
6099
by: John Rappold | last post by:
I've Googled this, but can't find an answer to my problem. When a user selects a page with the recordset I want it to list dates that fall into a certain range, related to CURDATE(). The range...
5
6509
by: Mal | last post by:
Hello. I have a database that tracks reservations at a campground. I want to be able to make a calendar type report that shows how many people are here in given period. Stored for each...
3
278
by: Not Me | last post by:
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...
2
3258
by: zeg37 | last post by:
Hi, I am working with a Microsoft Data Page where the records are filtered by two dates the user selects prior to any records being loaded. After selecting dates they click on a button (BtnGo)...
4
3610
by: Eugene Anthony | last post by:
I have a table that has a DateTime column which uses a DataTime datatype. How do I retrieve a range of records based on the month and year using ms sql? Eugene Anthony *** Sent via...
11
2623
by: lenygold via DBMonster.com | last post by:
Hi everybody! This query is supposed to count consecutive years from the current year without OLAP. Input Table: ID DateCol 1 02/01/2006 1 01/01/2006 1 01/01/2005
4
2838
by: rekhasc | last post by:
hi friends.. i am using sql server 2005 reporting services.. in database the table contains startdate row and enddate row... i want the query which display all the contents between these...
2
2064
by: bthalapathi | last post by:
I had a table called 'FruitSaleList', that contains the following columns sl.no, shop_id, fruitName, price, .... I had also another table called 'FruitList' that contains the columns ...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.