Distinct query not producing distinct results

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top