Re: How to remove duplicates from linked table query?
- From: "Van T. Dinh" <VanThien.Dinh@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Jan 2006 18:23:18 +1100
In that case, you should use a Parameter Query to return the CandidateID of
the Candidate that match you criteria. For example, you can use a query
with SQL String like:
SELECT DISTINCT CandidateID
FROM [YourTable]
WHERE
( (Indutry = [Enter Required Industry]) OR
([Enter Required Industry] Is Null) )
AND
( (Position = [Enter Required Position]) OR
([Enter Required Position] Is Null) )
--
HTH
Van T. Dinh
MVP (Access)
"Penny" <penny@xxxxxxxxxxxxxx> wrote in message
news:newscache$aps8ti$zu5$1@xxxxxxxxxxxxxxxxxxxxxxx
> Van,
>
> This query returns all the Candidates at least once and any Candidate who
> has Industries and/or Positions in the related tables is returned once for
> each combination of these. I guess I need to enter the Industry and/or
> Position as parameters into the query and return all Candidates who have
> at least one value for these two in at least one of the two linked tables.
>
> A Candidate search will be based on this query. For an example search the
> user may choose an Industry(say Banking) from a dropdown list on the
> search window, I would need to enter the industry as a parameter into the
> query. The user may also choose a Position(say Receptionist) in a similar
> fashion. The query should then return only the Candidates who have Banking
> against their ID in tblCandidateIndustries and Receptionist against their
> ID in tblPositions.
>
> I know my query is now different to what I first described.
>
> Penny.
>
> "Van T. Dinh" <VanThien.Dinh@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:unNRmm1GGHA.3320@xxxxxxxxxxxxxxxxxxxxxxx
>> Using your sample data, please advise which Industry and which Position
>> would you like the Query to return for Candidate 284?
>>
>> Also, please describe your criteria to select the above.
>>
>> --
>> HTH
>> Van T. Dinh
>> MVP (Access)
>>
>>
>>
>> "Penny" <penny@xxxxxxxxxxxxxx> wrote in message
>> news:newscache$q3e8ti$be2$1@xxxxxxxxxxxxxxxxxxxxxxx
>>> Hi All,
>>>
>>> I run a query on a 'tblCandidates' table linked to two other tables
>>> 'tblCandidateIndustries' and 'tblCandidatePositions' each of which may
>>> have many records pertaining to the Candidate in the parent table.
>>>
>>> The query returns every permutation of Candidate, Industry and Position
>>> in a seperate line, e.g.
>>>
>>> CandidateID Industry Position
>>>
>>> 543 Health Secretary
>>> 284 Aged Care Admin Assistant
>>> 284 Aged Care Receptionist
>>> 284 Construction Book Keeper
>>> 284 Construction Payroll
>>> 889 Banking Finance Broker
>>>
>>> But I only need to show each Candidate only once to display to the user.
>>> I haven't been able to get DISTINCT or FIRST to remove the duplicates.
>>> Any tips?
>>>
>>> Regards,
>>>
>>> Penny.
>>>
>>
>>
>
>
.
- Follow-Ups:
- References:
- How to remove duplicates from linked table query?
- From: Penny
- Re: How to remove duplicates from linked table query?
- From: Van T. Dinh
- Re: How to remove duplicates from linked table query?
- From: Penny
- How to remove duplicates from linked table query?
- Prev by Date: Re: run query for the system day
- Next by Date: Re: Queries Taking too Long......
- Previous by thread: Re: How to remove duplicates from linked table query?
- Next by thread: Re: How to remove duplicates from linked table query?
- Index(es):
Relevant Pages
|