Gustav Brock
Gustav at cactus.dk
Fri Mar 28 14:06:30 CDT 2008
Hi William
Can't be(!?). Indeed the second suggestion seems foolproof to me.
Could you rephrase your criteria please? Did you _miss_ records?
What happens if you remove DISTINCT from the second query:
SELECT
EPCID,
CompanyID,
CompanyName,
AdClass,
SGOn
FROM
qryTemp
WHERE
EPCID=11
OR
AdClass="A";
/gustav
>>> wdhindman at dejpolsystems.com 28-03-2008 19:37:51 >>>
gustav
...no ...both gave the same results I've been getting :(
William
----- Original Message -----
From: "Gustav Brock" <Gustav at cactus.dk>
To: <accessd at databaseadvisors.com>
Sent: Friday, March 28, 2008 1:23 PM
Subject: Re: [AccessD] deduping qry results
> Hi William
>
> Oh, missed that.
>
> Then how about:
>
> SELECT DISTINCT
> tblExhibitorProducts.EPCID,
> qryApr08Grid.CompanyID,
> qryApr08Grid.CompanyName,
> qryApr08Grid.AdClass,
> qryApr08Grid.SGOn
> FROM
> tblExhibitorProducts,
> qryApr08Grid
> WHERE
> (tblExhibitorProducts.CompanyID = qryApr08Grid.CompanyID)
> AND
> (tblExhibitorProducts.EPCID=11
> OR
> qryApr08Grid.AdClass="A");
>
> or:
>
> SELECT
> tblExhibitorProducts.EPCID,
> qryApr08Grid.*
> FROM
> tblExhibitorProducts,
> qryApr08Grid
> WHERE
> tblExhibitorProducts.CompanyID = qryApr08Grid.CompanyID;
>
> Feed this to:
>
> SELECT DISTINCT
> EPCID,
> CompanyID,
> CompanyName,
> AdClass,
> SGOn
> FROM
> qryTemp
> WHERE
> EPCID=11
> OR
> AdClass="A";
>
> /gustav
>
>
>>>> wdhindman at dejpolsystems.com 28-03-2008 18:01:53 >>>
> ...but the OR'd records have different EPCIDs and would thus be
> eliminated.
>
> William
>
> ----- Original Message -----
> From: "Gustav Brock" <Gustav at cactus.dk>
> To: <accessd at databaseadvisors.com>
> Sent: Friday, March 28, 2008 12:52 PM
> Subject: Re: [AccessD] deduping qry results
>
>
>> Hi William
>>
>> And so?
>> Just specify the parameter in the top query as well.
>>
>> /gustav
>>
>>>>> wdhindman at dejpolsystems.com 28-03-2008 17:06:38 >>>
>> ...love to but EPCID is a parameter supplied by the user.
>>
>> William
>>
>> ----- Original Message -----
>> From: "Gustav Brock" <Gustav at cactus.dk>
>> To: <accessd at databaseadvisors.com>
>> Sent: Friday, March 28, 2008 11:57 AM
>> Subject: Re: [AccessD] deduping qry results
>>
>>
>>> Hi William
>>>
>>> Couldn't you just remove DISTINCTROW and then use this query as source
>>> in
>>> another query where you use DISTINCT?
>>>
>>> /gustav
>>>
>>>>>> wdhindman at dejpolsystems.com 28-03-2008 16:43:06 >>>
>>> ...senior moment ...posted on another thread by mistake :(
>>>
>>> ...given the following query:
>>>
>>> SELECT DISTINCTROW tblExhibitorProducts.EPCID, qryApr08Grid.CompanyID,
>>> qryApr08Grid.CompanyName, qryApr08Grid.AdClass, qryApr08Grid.SGOn
>>> FROM tblExhibitorProducts INNER JOIN qryApr08Grid ON
>>> tblExhibitorProducts.CompanyID = qryApr08Grid.CompanyID WHERE
>>> (((tblExhibitorProducts.EPCID)=11)) OR (((qryApr08Grid.AdClass)="A"));
>>>
>>> ...how can I avoid duplicates in the OR results?
>>> ...I've tried totals and uniuqe values/records but nothing produces
>>> consistent results ...help!
>>>
>>> William