horncastlejohn
New member
- Local time
- Today, 21:27
- Joined
- Sep 2, 2007
- Messages
- 7
Hi all,
I am trying to create a query that will calculate the date for a follow up appointment based on a dateadd function which uses a starting date and an interval (both held in a table) and then only display certain of the results based on a parameter (another date) defined when the query is run. The SQL statement I have used is as follows;
SELECT Schedule.[Pt Name], Schedule.Regime, Schedule.[Recall Interval], DateAdd("d",[Recall Interval],[Appointment Date]) AS [Next Appointment]
FROM Schedule
WHERE (((DateAdd("d",[Recall Interval],[Appointment Date]))=[Enter Date]));
However when I run the query i get an error message "This expression is typed incorrectly, or it is too complex to be evaluated." The dateadd function works fine without the parameter query so I take it that this means access doesn't like working out a date and then filtering the results according to a parameter in the same query. I am clearly going about this in the wrong way so can anyone suggest a better way of achieving the same outcome.
Thanks.
I am trying to create a query that will calculate the date for a follow up appointment based on a dateadd function which uses a starting date and an interval (both held in a table) and then only display certain of the results based on a parameter (another date) defined when the query is run. The SQL statement I have used is as follows;
SELECT Schedule.[Pt Name], Schedule.Regime, Schedule.[Recall Interval], DateAdd("d",[Recall Interval],[Appointment Date]) AS [Next Appointment]
FROM Schedule
WHERE (((DateAdd("d",[Recall Interval],[Appointment Date]))=[Enter Date]));
However when I run the query i get an error message "This expression is typed incorrectly, or it is too complex to be evaluated." The dateadd function works fine without the parameter query so I take it that this means access doesn't like working out a date and then filtering the results according to a parameter in the same query. I am clearly going about this in the wrong way so can anyone suggest a better way of achieving the same outcome.
Thanks.