468,321 Members | 1,676 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

Limit result set to top 10

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
2 1646
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
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.

Similar topics

1 post views Thread by StinkFinger | last post: by
2 posts views Thread by Sundial Services | last post: by
1 post views Thread by Steve | last post: by
3 posts views Thread by Jay K | last post: by
2 posts views Thread by Mike | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.