(Access XP)
I have 2 queries on a group of patients, one lists those that are not well controlled after their first consultation and the other lists those that are not well controlled after their last consultation.
The query on both selects those patients who are not well controlled.
I would like to create one large query, which gives each patient a value of 0-3; if they are not well controlled first consultation then 0, well controlled first consult 1, not well controlled last consult 2, well controlled last consult 3.
Is there a way to do this?
I think it may be something like if query is true then assign the value in the column to be 0, then perform a UNION with the next query for the next value.
Hopefully the table I will end up with will look like this
PatientIndex Control
1 0
2 0
3 2
4 3
5 1
6 1
7 3
8 2
I have 2 queries on a group of patients, one lists those that are not well controlled after their first consultation and the other lists those that are not well controlled after their last consultation.
The query on both selects those patients who are not well controlled.
I would like to create one large query, which gives each patient a value of 0-3; if they are not well controlled first consultation then 0, well controlled first consult 1, not well controlled last consult 2, well controlled last consult 3.
Is there a way to do this?
I think it may be something like if query is true then assign the value in the column to be 0, then perform a UNION with the next query for the next value.
Hopefully the table I will end up with will look like this
PatientIndex Control
1 0
2 0
3 2
4 3
5 1
6 1
7 3
8 2