Grouping Distinct

A

acss

I have a query utilizing distinct as follows:

SELECT DISTINCT Vendor.VendorCtry
FROM Vendor
ORDER BY Vendor.VendorCtry;

The problem is that when the query is run it displays a country twice like
Turkey on one row and then the next. I have tried the grouping but have the
same results, is there another way to group records?
 
A

Allen Browne

If the country shows twice, there is a subtle differenc between the 2
entries, e.g. one entry might have a leading space.

To help track this, try:

SELECT DISTINCT Vendor.VendorCtry,
Len(Vendor.VendorCtry) AS HowManyChars
FROM Vendor
ORDER BY Vendor.VendorCtry;
 
A

acss

Thanks Allen,

You were right on with the leading space and i removed it by doing a search.
I did not get your "AS HowManyChars" so was i supposed to place numbers
following AS TO obtain an search?
 
A

Allen Browne

Good solved.

You posted your query statement (presumably from SQL View of a query.) Try
pasting what I suggested into query design if you want to experiment.
 

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

Similar Threads

Union Query Edit 1
Need some PWA help 0
SELECT DISTINCT query 8
COUNT and DISTINCT in Access 3
Select Distinct query 8
nested query hell 6
Help on Counting and grouping distinct records 3
Join Query Sort 2

Top