Distinct query not producing distinct results

  • Thread starter Thread starter KarenM
  • Start date Start date
K

KarenM

Greetings.
A2K, Win2K

I have a simple enough query, based on another query. When I run it,
it will not produce unique results. However, when I alter my query to
base it on the source query's underlying table, it will deliver unique
results. I want to use the query as my underlying recordsource if
possible because it contains some derived fields that I want to take
advantage of.

Can anyone tell me why my SQL won't deliver unique records when
pointing to a query?

Here's my SQL:
THIS WORKS:
SELECT DISTINCT tblStuff.colParentRefNum, tblStuff.colDescription
FROM tblStuff
WHERE (((tblStuff.colParentRefNum)="10-2-6"));

THIS DOESN'T:
SELECT DISTINCT qryStuff.colParentRefNum, qryStuff.colDescription
FROM qryStuff
WHERE (((qryStuff.colParentRefNum)="10-2-6"));


TIA...
Karen M.
 
We would need to know what your qryStuff consists of. Do you have a one-to-many relationship that would create multiple records



----- KarenM wrote: ----

Greetings
A2K, Win2

I have a simple enough query, based on another query. When I run it
it will not produce unique results. However, when I alter my query t
base it on the source query's underlying table, it will deliver uniqu
results. I want to use the query as my underlying recordsource i
possible because it contains some derived fields that I want to tak
advantage of

Can anyone tell me why my SQL won't deliver unique records whe
pointing to a query

Here's my SQL
THIS WORKS
SELECT DISTINCT tblStuff.colParentRefNum, tblStuff.colDescriptio
FROM tblStuf
WHERE (((tblStuff.colParentRefNum)="10-2-6"))

THIS DOESN'T
SELECT DISTINCT qryStuff.colParentRefNum, qryStuff.colDescriptio
FROM qryStuf
WHERE (((qryStuff.colParentRefNum)="10-2-6"))


TIA..
Karen M
 
Back
Top