By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,835 Members | 1,094 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,835 IT Pros & Developers. It's quick & easy.

Select Top 10 - tie

P: 7
Hello,

I am running a select Top 10 query. When there is a tie this query gives me numbers more than 10. I read some other posts, which talked about 'With Tie' clause included in the Top 10 predicate in Access.

Is there any way to work around such ties and display only 10 records (whether tying or not)?

Thanks
Jun 7 '07 #1
Share this Question
Share on Google+
5 Replies

Rabbit
Expert Mod 10K+
P: 12,441
Will including they primary key field cause problems?
Jun 7 '07 #2

P: 7
Will including they primary key field cause problems?


I do not have primary keys defined. I cant define them as this is a temporary reporting process and the data i get does not allow me to define primary keys - not even composite primary keys.
Even if there was a primary key, in this particular example, it may not be useful. Do you think there is any other way to tackle the Top 10 ties?
Thanks a lot for responding. I appreciate it.
Jun 7 '07 #3

Rabbit
Expert Mod 10K+
P: 12,441
I do not have primary keys defined. I cant define them as this is a temporary reporting process and the data i get does not allow me to define primary keys - not even composite primary keys.
Even if there was a primary key, in this particular example, it may not be useful. Do you think there is any other way to tackle the Top 10 ties?
Thanks a lot for responding. I appreciate it.
I was just thinking that if you had a primary key, you could just throw that into the the SELECT and it would mean you can't have a tie. What about throwing an autonumber field into the mix? As long as you're not using aggregate functions then it should be fine.

I don't think there's a way to get around the tie with a SQL predicate.
Jun 7 '07 #4

P: 7
I was just thinking that if you had a primary key, you could just throw that into the the SELECT and it would mean you can't have a tie. What about throwing an autonumber field into the mix? As long as you're not using aggregate functions then it should be fine.

I don't think there's a way to get around the tie with a SQL predicate.


Thanks a lot for your help. I added more columns to the ORDER BY clause to further minimize the possibility of a tie. I appreciate your help.
Jun 12 '07 #5

Rabbit
Expert Mod 10K+
P: 12,441
Thanks a lot for your help. I added more columns to the ORDER BY clause to further minimize the possibility of a tie. I appreciate your help.
Not a problem, good luck.
Jun 13 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.