Hi
I am a newbie to access 2000. I am trying to create a query to calulate a new date + interval. I have done several searches of the Tek-Tips with different key words before asking this.
I would like the user to be able to enter a start date and interval ie 14 and let access calculate appts for the rest of the year or for the next year.
I tried to [Date_Last_done]+[Intervalofappt] AS datenextAppt1, [dateNextAppt1]+[Intervalofappt] AS datenextAppt2, etc. When I do this I get prompted for each datenextappX. I included the sql to help.
This does not need to be linked to any table. I just want to be able to do simple calculations. I would output the results to a form, also not linked to a table, in datasheet format listing each datenextapptX and the user would manually enter dates in another table.
SELECT Customers.LastName, Customers.IntervalOfAppt, Date_last_done.Date_last_done, Date_last_done.DateNextAppt, [Date_Last_done]+[Intervalofappt] AS datenextAppt1, [dateNextAppt1]+[Intervalofappt] AS datenextAppt2, [dateNextAppt2]+[Intervalofappt] AS datenextAppt3, [dateNextAppt3]+[Intervalofappt] AS datenextAppt4,
etc ...
[dateNextAppt30]+[Intervalofappt] AS datenextAppt31, [dateNextAppt31]+[Intervalofappt] AS datenextAppt32
FROM Customers LEFT JOIN Date_last_done ON Customers.CustomerID = Date_last_done.Customer_ID
ORDER BY Date_last_done.Date_last_done, Date_last_done.DateNextAppt, [Date_Last_done]+[Intervalofappt], [dateNextAppt1]+[Intervalofappt], [dateNextAppt2]+[Intervalofappt], [dateNextAppt3]+[Intervalofappt], [dateNextAppt4]+[Intervalofappt],
etc...
[dateNextAppt29]+[Intervalofappt], [dateNextAppt30]+[Intervalofappt], [dateNextAppt31]+[Intervalofappt];
Thank you for your suggestions
Mark
I am a newbie to access 2000. I am trying to create a query to calulate a new date + interval. I have done several searches of the Tek-Tips with different key words before asking this.
I would like the user to be able to enter a start date and interval ie 14 and let access calculate appts for the rest of the year or for the next year.
I tried to [Date_Last_done]+[Intervalofappt] AS datenextAppt1, [dateNextAppt1]+[Intervalofappt] AS datenextAppt2, etc. When I do this I get prompted for each datenextappX. I included the sql to help.
This does not need to be linked to any table. I just want to be able to do simple calculations. I would output the results to a form, also not linked to a table, in datasheet format listing each datenextapptX and the user would manually enter dates in another table.
SELECT Customers.LastName, Customers.IntervalOfAppt, Date_last_done.Date_last_done, Date_last_done.DateNextAppt, [Date_Last_done]+[Intervalofappt] AS datenextAppt1, [dateNextAppt1]+[Intervalofappt] AS datenextAppt2, [dateNextAppt2]+[Intervalofappt] AS datenextAppt3, [dateNextAppt3]+[Intervalofappt] AS datenextAppt4,
etc ...
[dateNextAppt30]+[Intervalofappt] AS datenextAppt31, [dateNextAppt31]+[Intervalofappt] AS datenextAppt32
FROM Customers LEFT JOIN Date_last_done ON Customers.CustomerID = Date_last_done.Customer_ID
ORDER BY Date_last_done.Date_last_done, Date_last_done.DateNextAppt, [Date_Last_done]+[Intervalofappt], [dateNextAppt1]+[Intervalofappt], [dateNextAppt2]+[Intervalofappt], [dateNextAppt3]+[Intervalofappt], [dateNextAppt4]+[Intervalofappt],
etc...
[dateNextAppt29]+[Intervalofappt], [dateNextAppt30]+[Intervalofappt], [dateNextAppt31]+[Intervalofappt];
Thank you for your suggestions
Mark