John
Help
I am not able to get unique records relating to the field
"tbl_consultations.conpfn"
This field stores a common file number and I only want one record to appear
for each file number.
Here is the SQL I have at this time:-
SELECT tbl_consultations.conid, tbl_consultations.conpid,
tbl_consultations.conpfn, tbl_consultations.conpcn, Demographic.[Name
First], Demographic.[Name Last], Demographic.[Search Key], Demographic.[Home
Phone], Demographic.[Birth Date]
FROM tbl_consultations INNER JOIN Demographic ON tbl_consultations.conpfn =
Demographic.[File #]
WHERE (((Demographic.[Search Key]) Not Like "R*"));
Regards
Barry
> Hi John
>
[quoted text clipped - 59 lines]
>>>> Regards
>>>> Barry
John Spencer - 16 Nov 2005 21:05 GMT
Well, since I can't see your table structure I am at a disadvantage on
helping you with this.
SELECT DISTINCT tbl_consultations.conid, tbl_consultations.conpid,
tbl_consultations.conpfn, tbl_consultations.conpcn,
Demographic.[Name First], Demographic.[Name Last],
Demographic.[Search Key],
Demographic.[Home Phone], Demographic.[Birth Date]
FROM tbl_consultations INNER JOIN Demographic ON tbl_consultations.conpfn =
Demographic.[File #]
WHERE (((Demographic.[Search Key]) Not Like "R*"));
This will return one row for each combination of values. But if ConID for
example has two values for a value of ConPFN then you will get two rows
returned one for each combination of ConID and ConPFN.
You might post a copy of two rows that you consider duplicates and a row of
what you expect to see instead of the two rows. That might help to
understand your problem.
> John
>
[quoted text clipped - 82 lines]
>>>>> Regards
>>>>> Barry
Barry McConomy - 17 Nov 2005 19:52 GMT
John
Thanks for your help.
I used your SQL code and removed the fields "conid" and "conpid" (I did not
require this data for my report) and all worked fine.
Again many thanks for your help.
Regards
Barry
> Well, since I can't see your table structure I am at a disadvantage on
> helping you with this.
[quoted text clipped - 102 lines]
>>>>>> Regards
>>>>>> Barry