This is a cursor issue not an issue with the key word distinct.
Try setting your cursor to Client side....
> Hello.
>
[quoted text clipped - 15 lines]
> Can anyone help me? Thanks.
> Raymond
Thanks for Kent reply.
But, ...
Because I just want to count how many of
distinct records on field [t_ID] in table [T].
Can I just pass the SQL statement into the
recordset instead of creating cursor?
Thank you very much for any more help ...
Raymond
>-----Original Message-----
>This is a cursor issue not an issue with the key word distinct.
[quoted text clipped - 22 lines]
>
>.
Graham Dobson - 31 Jul 2003 16:15 GMT
> Because I just want to count how many of
> distinct records on field [t_ID] in table [T].
>
> Can I just pass the SQL statement into the
> recordset instead of creating cursor?
How about
SELECT [t_id], Count[t_id]
FROM Table
GROUP BY [t_id]
-- Graham
You might compare the performance of this versus
SELECT DISTINCT [t_id], Count[t_id]
FROM Table
Calling recordset.RecordCount or doing DISTINCT or DISTINCTROW queries are
hardly ever efficient things to do. -- Graham
Graham Dobson - 31 Jul 2003 17:04 GMT
On second thought what you might need is:
SELECT COUNT(DISTINCT [t_id]) FROM TABLE
-- Graham