Another alternative is to create 3 tables:
Years
YearNumber - Integer
Months
MonthNumber - Integer
Days
DayNumber - Integer
The Days table will have 31 rows (values 1 through 31), the Months table
will have 12 rows (values 1 through 12) and the Years table will have one
row for each year of interest (values 1950 through 2008?)
Once you have those three tables, you can create a query that will return
one row for each day of interest using the following SQL:
SELECT DateSerial([YearNumber],[MonthNumber],[DayNumber]) AS WhatDate
FROM Days, Months, Years
WHERE (((IsDate([YearNumber] & "-" & [MonthNumber] & "-" &
[DayNumber]))=True))
ORDER BY 1;
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"John Spencer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Create your table and then run code like the following UNTESTED code
>
> Public Sub AddDates(dteStart as Date, dteEnd as Date)
> Dim dbAny as DAO.Database
> Dim rst as DAO.Recordset
> Dim iCount as Long
>
> Set dbany = CurrentDb()
> Set rst = dbany.OpenRecordset("SELECT TheDate FROM CalendarTable" & _
> " WHERE TheDate is Null")
>
> With rst
> For iCount = 0 To DateDiff("d", dteStart, dteEnd)
> .AddNew
> rst!TheDate = DateAdd("d", iCount, dteStart)
> .Update
> Next iCount
> End With
>
> End Sub
>
> John Spencer
> Access MVP 2002-2005, 2007-2008
> The Hilltop Institute
> University of Maryland Baltimore County
>
> Bruce wrote:
>> I want to create a date table that lists the date (short date format)
>> from a given date to current. The only field would be the date (say from
>> January 1, 1950) field. Is there a master date table already in existence
>> that I could edit for the date range for my circumstances?