Hi,
Anyone has the answer to this issue please let me know. It sounds easy but I can't seem to solve it. I am using Access 2007.
Thanks in advance.
I have 2 tables with data same number of columns. when I linked them in a query I get duplicate data.
Table 1
Patient MRN DelTime Type Art
John 12 1/1/11 B 7.39
John 12 1/1/11 B 7.37
Table2
Patient MRN DelTime Type Ven
John 12 1/1/11 B 7.41
John 12 1/1/11 B 7.40
When I combine them in a query:
SELECT DISTINCT Table1.Patient, Table1.MRN, Table1.DelTime, Table1.Type, Table1.Art, Table2.Ven
FROM Table1 LEFT JOIN Table2 ON Table1.MRN = Table2.MRN;
the result is:
Patient MRN DelTime Type Art Ven
John 12 1/1/11 B 7.39 7.40
John 12 1/1/11 B 7.39 7.41
John 12 1/1/11 B 7.37 7.40
John 12 1/1/11 B 7.37 7.41
It create a duplicate as you see above. What I am looking for is 2 lines:
Patient MRN DelTime Type Art Ven
John 12 1/1/11 B 7.39 7.40
John 12 1/1/11 B 7.37 7.41
I have tried min and max but obviously that does not work.
If this can be done in access or sqol is great if Excel that's also ok
Anyone has the answer to this issue please let me know. It sounds easy but I can't seem to solve it. I am using Access 2007.
Thanks in advance.
I have 2 tables with data same number of columns. when I linked them in a query I get duplicate data.
Table 1
Patient MRN DelTime Type Art
John 12 1/1/11 B 7.39
John 12 1/1/11 B 7.37
Table2
Patient MRN DelTime Type Ven
John 12 1/1/11 B 7.41
John 12 1/1/11 B 7.40
When I combine them in a query:
SELECT DISTINCT Table1.Patient, Table1.MRN, Table1.DelTime, Table1.Type, Table1.Art, Table2.Ven
FROM Table1 LEFT JOIN Table2 ON Table1.MRN = Table2.MRN;
the result is:
Patient MRN DelTime Type Art Ven
John 12 1/1/11 B 7.39 7.40
John 12 1/1/11 B 7.39 7.41
John 12 1/1/11 B 7.37 7.40
John 12 1/1/11 B 7.37 7.41
It create a duplicate as you see above. What I am looking for is 2 lines:
Patient MRN DelTime Type Art Ven
John 12 1/1/11 B 7.39 7.40
John 12 1/1/11 B 7.37 7.41
I have tried min and max but obviously that does not work.
If this can be done in access or sqol is great if Excel that's also ok
Last edited: