Good Afternoon Ladies and Gentlemen of this forum, I had a question for all of you.
I am trying to write a query. The idea of the query is showing when a person needs a new appointment. I now have a query which gives the Last Name, the first date they visited, and a so called 'visit number'.
The visits follow a set pattern. The second appointment is always 10 days after the first one. Then, the third appointment is 2 months after the first appointment. The fourth appointment is half a year after the first appointment, and that goes on for about 8 appointments.
The 'visit number' is a number which indicates this. For instance, the first visit goes with a visit number of 1, the second visit with visit number 2, etc.
So, as said, I now have a query which shows me the last name of a patient, the date for the first visit, and the visit number. What I want is to add an amount of time that first date, depending on the visit number. I then want to output the last name, and the first date plus the amount of time added.
What I imagine is this. I have the first date, and the study number. Somewhere (this is one of the problems, where?) I have a list that says,
if visit number = 1,
then VariableX = 10 days
if visit number = 2,
then VariableX = 2 months
Etc.
I would then make VariableX a field in the query.
Finally, I would make another field, which would be the first_date field plus VariableX, and then output that.
My question consists of 2 parts.
First off, is this the smart way to do this? Is there an easier way? It seems that this is a reasonably straightforward way to me, but I'm not a very experienced programmer.
Secondly, if this is a good idea, then how do I do that? I need to have a list somewhere where that conversion happens, where do I put that? Do I make it a separate table? Can I put this in a query?
I hope someone can help me, because it seems like this might be a common problem.
Thanks on beforehand,
David.
PS: If there is any more information that you need to properly answer my question, I'd be happy to supply, just ask!
I am trying to write a query. The idea of the query is showing when a person needs a new appointment. I now have a query which gives the Last Name, the first date they visited, and a so called 'visit number'.
The visits follow a set pattern. The second appointment is always 10 days after the first one. Then, the third appointment is 2 months after the first appointment. The fourth appointment is half a year after the first appointment, and that goes on for about 8 appointments.
The 'visit number' is a number which indicates this. For instance, the first visit goes with a visit number of 1, the second visit with visit number 2, etc.
So, as said, I now have a query which shows me the last name of a patient, the date for the first visit, and the visit number. What I want is to add an amount of time that first date, depending on the visit number. I then want to output the last name, and the first date plus the amount of time added.
What I imagine is this. I have the first date, and the study number. Somewhere (this is one of the problems, where?) I have a list that says,
if visit number = 1,
then VariableX = 10 days
if visit number = 2,
then VariableX = 2 months
Etc.
I would then make VariableX a field in the query.
Finally, I would make another field, which would be the first_date field plus VariableX, and then output that.
My question consists of 2 parts.
First off, is this the smart way to do this? Is there an easier way? It seems that this is a reasonably straightforward way to me, but I'm not a very experienced programmer.
Secondly, if this is a good idea, then how do I do that? I need to have a list somewhere where that conversion happens, where do I put that? Do I make it a separate table? Can I put this in a query?
I hope someone can help me, because it seems like this might be a common problem.
Thanks on beforehand,
David.
PS: If there is any more information that you need to properly answer my question, I'd be happy to supply, just ask!
Comment