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

Return certain number of records from a query

P: 29
I was wondering how to go aboout returning say the last 10 records of a query.

the query is just a reproduction of a table.
the querey is set up like

SELECT fields FROM table ORDER BY date/time

now, is there a part where i can have something WHERE count <11 to have the 10 most recently dated items?

Thanx
Dec 7 '06 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Try

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT TOP 10 fields FROM table ORDER BY date/time DESC;
  3.  
Mary

I was wondering how to go aboout returning say the last 10 records of a query.

the query is just a reproduction of a table.
the querey is set up like

SELECT fields FROM table ORDER BY date/time

now, is there a part where i can have something WHERE count <11 to have the 10 most recently dated items?

Thanx
Dec 7 '06 #2

P: 29
ahhh. yeah works great.

thanks.


Try

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT TOP 10 fields FROM table ORDER BY date/time DESC;
  3.  
Mary
Dec 7 '06 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
ahhh. yeah works great.

thanks.
You're welcome.
Dec 7 '06 #4

Post your reply

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