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

Sql Query

xtianixm
P: 52
i use a MS access database. if i a have 20 record in my database. what is the query when i want only 10 record to display?
Jan 31 '08 #1
Share this Question
Share on Google+
3 Replies


P: 68
i use a MS access database. if i a have 20 record in my database. what is the query when i want only 10 record to display?

Hi,
Here you do not mention what 10 records, first or last. For my method, you have to add an extra field that indicates the original position or number of data in those records. Then you can do that by WHERE clause. You can use like this 'WHERE ID<11'.

Get Better.

Regards,
shuvo2k6
Jan 31 '08 #2

Expert 5K+
P: 8,434
Moved from VB to Access forum.
Jan 31 '08 #3

Jim Doherty
Expert 100+
P: 897
i use a MS access database. if i a have 20 record in my database. what is the query when i want only 10 record to display?
You use the TOP clause in SQL

SELECT TOP 10

which in Access equates to right clicking in the query designer where the tables are and selecting the properties box where you will see the property called 'Top Values' insert there the number of rows you wish to retrieve. You will only get the number of rows you state and it will be the first 10 rows if that is your stipulation. How you sort and sift using criteria is a different matter

Regards

Jim :)
Jan 31 '08 #4

Post your reply

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