G
Guest
I have two tables that are linked by an account number and encounter date. In the main table, a unique record exists for every account number and encounter date. The other table contains note records and so there can be multiple records in that table that tie back to the unique record in the "main" table.
I am trying to design a query for a report which will allow me to print out "main" records with the notes listed on the print-out. I don't want the "main" records to be printed multiple times when there are multiple notes. However, that is exactly what is happening. If the account has three notes in the notes table then I end up with three occurrences of the "main" record being pulled for my report. I don't know how to go about telling the query not to repeat the "main" record just because there are multiple occurrences in the other table.
For example, suppose I have the the following account:
John Smith
And he has detail surrounding three encounter dates:
1/5/2004
2/23/2004
4/12/2004
For the 1/5/2004 encounter there are two notes in the notes table.
For the 2/23/2004 encounter there are three notes in the notes table.
For the 4/12/2004 encounter there are two notes in the notes table.
Assuming each line below is a page on my report here is what currently end up getting on my report:
John Smith --- 1/5/2004 --- Note 1 and Note 2 data
John Smith --- 1/5/2004 --- Note 1 and Note 2 data
John Smith --- 2/23/2004 --- Note 1, Note 2, and Note 3 data
John Smith --- 2/23/2004 --- Note 1, Note 2, and Note 3 data
John Smith --- 2/23/2004 --- Note 1, Note 2, and Note 3 data
John Smith --- 4/12/2004 --- Note 1 and Note 2 data
John Smith --- 4/12/2004 --- Note 1 and Note 2 data
Basically... a 7 page report when really all I want is a 3 page report with one page per unique encounter for John Smith. Again, assuming each line below is a page on my report here is what I want my report to produce:
John Smith --- 1/5/2004 --- Note 1 and Note 2 data
John Smith --- 2/23/2004 --- Note 1, Note 2, and Note 3 data
John Smith --- 4/12/2004 --- Note 1 and Note 2 data
Any suggestions on how to keep the one for many relationship between my "main" table and my notes table from creating the duplicate report pages?
Thanks,
David
I am trying to design a query for a report which will allow me to print out "main" records with the notes listed on the print-out. I don't want the "main" records to be printed multiple times when there are multiple notes. However, that is exactly what is happening. If the account has three notes in the notes table then I end up with three occurrences of the "main" record being pulled for my report. I don't know how to go about telling the query not to repeat the "main" record just because there are multiple occurrences in the other table.
For example, suppose I have the the following account:
John Smith
And he has detail surrounding three encounter dates:
1/5/2004
2/23/2004
4/12/2004
For the 1/5/2004 encounter there are two notes in the notes table.
For the 2/23/2004 encounter there are three notes in the notes table.
For the 4/12/2004 encounter there are two notes in the notes table.
Assuming each line below is a page on my report here is what currently end up getting on my report:
John Smith --- 1/5/2004 --- Note 1 and Note 2 data
John Smith --- 1/5/2004 --- Note 1 and Note 2 data
John Smith --- 2/23/2004 --- Note 1, Note 2, and Note 3 data
John Smith --- 2/23/2004 --- Note 1, Note 2, and Note 3 data
John Smith --- 2/23/2004 --- Note 1, Note 2, and Note 3 data
John Smith --- 4/12/2004 --- Note 1 and Note 2 data
John Smith --- 4/12/2004 --- Note 1 and Note 2 data
Basically... a 7 page report when really all I want is a 3 page report with one page per unique encounter for John Smith. Again, assuming each line below is a page on my report here is what I want my report to produce:
John Smith --- 1/5/2004 --- Note 1 and Note 2 data
John Smith --- 2/23/2004 --- Note 1, Note 2, and Note 3 data
John Smith --- 4/12/2004 --- Note 1 and Note 2 data
Any suggestions on how to keep the one for many relationship between my "main" table and my notes table from creating the duplicate report pages?
Thanks,
David