473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Retirn only a limited number of results.

Hi
How can I limit the number of results returned from and SQL database to a
datagrid. Ie I only want to return the latest ten news items for a news and
events page.

Thanks
Kenneth
Nov 18 '05 #1
3 1100
Hi,
You can do it this way
select top 10 newsitems from newsTable order by date_time

HTH
srini
"Kenneth Keeley" wrote:
Hi
How can I limit the number of results returned from and SQL database to a
datagrid. Ie I only want to return the latest ten news items for a news and
events page.

Thanks
Kenneth

Nov 18 '05 #2
Hi Kenneth,
I think SQL should be able to tackle that in your Query!
Patrick


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3
Latest 10 should have DESC direction of ordering

select top 10 newsitems from newsTable order by date_time desc

assuming that "date_time" is of datetime type

"srini" <sr***@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
Hi,
You can do it this way
select top 10 newsitems from newsTable order by date_time

HTH
srini
"Kenneth Keeley" wrote:
Hi
How can I limit the number of results returned from and SQL database to a datagrid. Ie I only want to return the latest ten news items for a news and events page.

Thanks
Kenneth

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Margo | last post by:
Hi there I am fairly new to php & MySQL. I have been trying to set up a query and limit the result 12 records per page - 2 columns by 6 rows. Each record contains various fields. I have been...
29
by: Steven Bethard | last post by:
Fuzzyman wrote: > Cameron Laird wrote: > > >>This is a serious issue. >> >>It's also one that brings Tcl, mentioned several >>times in this thread, back into focus. Tcl presents >>the...
4
by: 2003et | last post by:
Hi, I have a search system which shows results in REPEATER but, it shows, for example 80 data item once, but I want to show the results page by page in groups of 10. 1-10 11-20 21-30 ... etc....
4
by: Tim T | last post by:
Hi, I have a stored procedure executing a search and an asp.net page displaying the results in a datagrid. The datagrid has paging on it, I am using Visual Studio.NET and can't see any option...
1
by: Sheau Wei | last post by:
Below is my search engine code. I realize that the function was very limitied because i cannot searching the "NamaPealatan"(name of tools) compatible to the either categories Operasi or Balai or...
4
by: jmarc | last post by:
Is that right.. under Win 98.. The quantity of records in a table is limited to 65535..? Argument is a 'long' was supported by only 32 bits under Win 98...! Who may talk a bit more about...
19
by: VK | last post by:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/ b495b4898808fde0> is more than one month old - this may pose problem for posting over some news servers. This is why I'm...
28
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I convert a Number into a String with exactly 2 decimal places?...
9
by: clintonb | last post by:
I'm looking for a way to calculate the number of days between two dates using standard C++ functions. Would it be as simple as just using the difftime() function and then dividing that result by...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.