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

Limit result set to top 10

P: n/a
MX1
Hi,

I have a VERY LONG, VERY COMPLEX query with about 1300 rows of data (e.g.
custFirst, custLast, custAddress1, custAddress2, custCity, custState,
custZip, custBalanceDue).

Is there a way to program it in such a way to only give me the rows with top
10 values of a field in the result set (e.g. Balance Due)? I don't need to
see all 1300.

Thanks!
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Sun, 11 Jul 2004 04:28:11 GMT, "MX1" <mx*@mx1.abc> wrote:
Hi,

I have a VERY LONG, VERY COMPLEX query with about 1300 rows of data (e.g.
custFirst, custLast, custAddress1, custAddress2, custCity, custState,
custZip, custBalanceDue).

Is there a way to program it in such a way to only give me the rows with top
10 values of a field in the result set (e.g. Balance Due)? I don't need to
see all 1300.

Thanks!


In the SQL view of the query after the word SELECT put TOP 10

eg
SELECT TOP 10 Field1, Field2 FROM tblSomeTable etc
Wayne Gillespie
Gosford NSW Australia
Nov 13 '05 #2

P: n/a
MX1
wow, I didn't even know that existed. Thanks!

"Wayne Gillespie" <be*****@NObestfitsoftwareSPAM.com.au> wrote in message
news:4r********************************@4ax.com...
On Sun, 11 Jul 2004 04:28:11 GMT, "MX1" <mx*@mx1.abc> wrote:
Hi,

I have a VERY LONG, VERY COMPLEX query with about 1300 rows of data (e.g.
custFirst, custLast, custAddress1, custAddress2, custCity, custState,
custZip, custBalanceDue).

Is there a way to program it in such a way to only give me the rows with top10 values of a field in the result set (e.g. Balance Due)? I don't need tosee all 1300.

Thanks!


In the SQL view of the query after the word SELECT put TOP 10

eg
SELECT TOP 10 Field1, Field2 FROM tblSomeTable etc
Wayne Gillespie
Gosford NSW Australia

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.