473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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 1485
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
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
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
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
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
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
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
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
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
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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,...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.