Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
How to take first 5 records from recordset???
Old 01-28-2006, 09:39 PM How to take first 5 records from recordset???
Ram
Novice Talker

Posts: 12
Trades: 0
i have a student details in a database.
Now i want to fetch only top 5 records from studentTable..

I am try in sql statement(top 5), it become a error...

i want to know what is error?
or there some other way to fetch first 5 records from table..
__________________
Editor

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Ram is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-29-2006, 06:53 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
what database are you using?

TOP is a T-SQL variation so is MS specific
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-29-2006, 09:42 PM
Ram
Novice Talker

Posts: 12
Trades: 0
i am using MSACCESS9.0
__________________
Editor

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Ram is offline
Reply With Quote
View Public Profile
 
Old 01-30-2006, 09:42 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
in that case

SELECT TOP 5 fieldlist FROM table

should work ok. What query are you using and what is the error?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-30-2006, 09:30 PM
Ram
Novice Talker

Posts: 12
Trades: 0
Thanks chrishirst!

i use top(fieldlist) instead of top 5 fieldslist.
__________________
Editor

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Ram is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to take first 5 records from recordset???
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14650 seconds with 12 queries