Re:
I cannot sort or search for duplicates in SQL, because the
first line contains a lot of spaces in-between the headings which doesn't
make
a qualified column name.
That doesn't seem to make sense - in order to get a recordset you must be
specifying some SQL? You can determine the 'real' field names by enumerating
the fields collection or just use the numeric field indexes 0 to however
many fields.
eg. SELECT TOP 1 * FROM Table
will get a single row recordset that you can look at to get the field names.
However, you know what you have so I'll stop there and let you decide what's
easiest to implement (array manipulation or SQL).
Chris.
Please see reply to Ray
--
Michelle
Chris Barber said:
You'd be better off getting another recordset with the duplicate counts
already created for you?
SELECT [Name] as UserName, Count([Name]) as CountOfUserName
FROM YourTable
GROUP BY [Name]
ORDER BY Count([Name]) DESC
This will give you:
UserName CountOfUserName
Chris 10
Dave 7
Henrik 2
Michale 1
Joan 1
etc.
If you only want the duplicates listed then change it to be:
SELECT [Name] as UserName, Count([Name]) as CountOfUserName
FROM YourTable
WHERE Count([Name]) > 1
GROUP BY [Name]
ORDER BY Count([Name]) DESC
Hope this helps.
Chris.
hi,
i have created an array from recordset containing user names
eg. (davidp, davidp, evenf, patricka, rebeccah)
which i have sorted in alphabetical order, but i need to
identify duplicates in this array and the number of times it has
been duplicated.
can someone help?