Douglas,
Why not simplify the query a bit
SELECT Distinct DateSerial([YearNumber],[MonthNumber],[DayNumber]) AS
WhatDate
FROM Days, Months, Years
That way you don't need the WHERE clause at all. And probably you don't
need the order by clause either - the distinct will probably do the order
by for you automatically.
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
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;