austin3i62
New member
- Local time
- Today, 01:46
- Joined
- Jan 28, 2013
- Messages
- 4
Greetings. I am a very very very novice Access user, making a database for a research group unit on my own. The layout of the db is pretty simple. Only two tables: Table 1 holds patient demographic information, and Table 2 holds dates for all appointments the patient has completed. They are linked by a unique four digit subject id (SID).
Our study conducts interviews with participants over a period of 15 months. There are 7 interview points (Baseline, 1, 3, 6, 9, 12 and 15 months). The date that the participant's next appointment is due is based on their baseline appointment, with alot of flexibility based on the participant's needs (they can come in a week early and up to 2 weeks late for the 1month, and the rest have a window of 1 month early to 1 month late. For example, someone due for their 6m on 6/1/2014 could complete it as early as 5/1/14 and as late as 7/1/14. To this end I created a query that generates the due dates for appointments based on their baseline date.
What I am trying to do is write a query that I can use to generate a report. This would tell me all the participant's who are due for an appointment in the current week or the current month. I've been able to do this for each appointment without a problem, however, I have been unsuccessful in getting Access to display all the participants due this month regardless of which appointment they are due for. In other words, I can get a query to tell me all the SIDs who have not yet completed their 1m and are still within range to complete it. I use a checkbox to indicate whether an interview has been completed for each interval, and if this checkbox has not been checked, they haven't completed their appointment. The query I made that works for this is simply to have 2 fields from the Follow-up table (SID and the 1m completed checkbox field) and determine if their due date for their 1m is between date()-7 and Date()+14. This works for all the appointments. My trouble is figuring out how to check if they are due for ANY appointments. In other words, I don't want to have 7 separate queries for each appointment date, I just want 1 query that will determine if any appointment is due.
Any help or tips would be greatly appreciated.
Our study conducts interviews with participants over a period of 15 months. There are 7 interview points (Baseline, 1, 3, 6, 9, 12 and 15 months). The date that the participant's next appointment is due is based on their baseline appointment, with alot of flexibility based on the participant's needs (they can come in a week early and up to 2 weeks late for the 1month, and the rest have a window of 1 month early to 1 month late. For example, someone due for their 6m on 6/1/2014 could complete it as early as 5/1/14 and as late as 7/1/14. To this end I created a query that generates the due dates for appointments based on their baseline date.
What I am trying to do is write a query that I can use to generate a report. This would tell me all the participant's who are due for an appointment in the current week or the current month. I've been able to do this for each appointment without a problem, however, I have been unsuccessful in getting Access to display all the participants due this month regardless of which appointment they are due for. In other words, I can get a query to tell me all the SIDs who have not yet completed their 1m and are still within range to complete it. I use a checkbox to indicate whether an interview has been completed for each interval, and if this checkbox has not been checked, they haven't completed their appointment. The query I made that works for this is simply to have 2 fields from the Follow-up table (SID and the 1m completed checkbox field) and determine if their due date for their 1m is between date()-7 and Date()+14. This works for all the appointments. My trouble is figuring out how to check if they are due for ANY appointments. In other words, I don't want to have 7 separate queries for each appointment date, I just want 1 query that will determine if any appointment is due.
Any help or tips would be greatly appreciated.