When this started you had a table but it was not named Count. Here is the
SQL using a table named Doug and another named Count. Count just contains
numbers one through your maximum date spread.
SELECT Doug.LastTransfer, Doug.DayDiff, CVDate([LastTransfer])+[Count] AS
[My Dates]
FROM [Count], Doug
WHERE (((CVDate([LastTransfer])+[Count])<=CVDate([DayDiff])));
Doug said:
Count
--
Doug
KARL DEWEY said:
What is the name of the table that has fields LastTransfer and DayDiff?
:
Karl,
Thanks.
SELECT Count.LastTransfer, Count.DayDiff, CVDate([LastTransfer])+[DayDiff]
AS [My Dates]
FROM [Count]
WHERE (((CVDate([LastTransfer])+[DayDiff])<=Date()));
--
Doug
:
Please post your select query for me.
:
Karl,
Now I'm really confused. Do I combine the two tables, the table I created
with [LastTransfer] and [DayDiff] into the new table named Count that has a
[Count] field with numbers 1 through whatever? What am I missing?
--
Doug
:
Ooops!
I forgot to say you need a table named Count with numbers from 1 through the
highest spread of your dates.
The query adds the number from the Count table to LastTransfer date until it
matches the DayDiff.
:
Thanks Karl but I must be doing something wrong. I am just getting today's
date with the following:
SELECT CVDate([LastTransfer])+[DayDiff] AS [My Dates]
FROM [Count]
WHERE (((CVDate([LastTransfer])+[DayDiff])<=Date()));
Thanks
--
Doug
:
Try this --
SELECT CVDate([LastTransfer])+[Count] AS [My Dates]
FROM [Count]
WHERE (((CVDate([LastTransfer])+[Count])<=CVDate([Date])));
You should not have a field named Date as it is a reserved word and cause
problems. Also you will have to update it all the time. Why not just use
Date() like below?
SELECT CVDate([LastTransfer])+[Count] AS [My Dates]
FROM [Count]
WHERE (((CVDate([LastTransfer])+[Count])<=Date()));
:
I have a field in a table that is [LastTransfer]. I also have a field in the
same table that is [Date] (Today's Date). I can calculate the days between
with the DateDiff function. Is there a way to list all the dates between
[LastTransfer] and [Date]?