Guest_imported
New member
- Jan 1, 1970
- 0
Hi
I wish to limit the number of records retrieved from a table. I am only retrieving one column from the table, and it is not unique, but I only want the first 10 values. I have tried the following, but Access does not appreciate it:-
Set rstThread = dbsExperiment.OpenRecordset("select top 10 distinct(id_field) from table order by id_field desc;", dbOpenForwardOnly)
I canl happily retrieve the distinct field values, or the top 10 field values, but not the top 10 distinct values. Is it possible?
All the best
Keith
I wish to limit the number of records retrieved from a table. I am only retrieving one column from the table, and it is not unique, but I only want the first 10 values. I have tried the following, but Access does not appreciate it:-
Set rstThread = dbsExperiment.OpenRecordset("select top 10 distinct(id_field) from table order by id_field desc;", dbOpenForwardOnly)
I canl happily retrieve the distinct field values, or the top 10 field values, but not the top 10 distinct values. Is it possible?
All the best
Keith