Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Ranking

Author  Topic 

disha
Starting Member

34 Posts

Posted - 2008-02-14 : 01:17:43
Hi,

I want to create a prompt for the user so that he can enter values like 1, 2 , 3till 25 ,
These values indicate ranks of city based on the profit amount .

I need the code which will display the following rank functionality .

Plz helpp.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-02-14 : 02:37:54
You need to provide more information for us to help you.

Do post your table structure, sample data and expected result


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

disha
Starting Member

34 Posts

Posted - 2008-02-14 : 04:31:50
need help....
in my senario
i need to reflets rank functionality.
bcoz....i have user inputs like start date , end date and top payments.
in the top payments if user enter 3 it has to show top three amounts
if user enter 10 it has to show top 10 payments......and it is given as default of 25.
if user didn't enter any value it has to show top 25 amounts..
so plz give any idea

something like ampersand @ in oracle which prompts users to enter any value
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-14 : 04:51:50
Dont you have a front end application for getting the top payments value from user. and you can use it as a parameter in your sp and return first n top payments.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-02-14 : 04:53:10
quote:
something like ampersand @ in oracle which prompts users to enter any value

This should be handle in your front end application. T-SQL is not able to do that.

quote:
Originally posted by disha

need help....
in my senario
i need to reflets rank functionality.
bcoz....i have user inputs like start date , end date and top payments.
in the top payments if user enter 3 it has to show top three amounts
if user enter 10 it has to show top 10 payments......and it is given as default of 25.
if user didn't enter any value it has to show top 25 amounts..
so plz give any idea



declare @rows int
select @rows = 20

set rowcount @rows

select *
from yourtable
where datecol >= @startdate
and datecol <= @enddate
order by payments desc

set rowcount 0



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

disha
Starting Member

34 Posts

Posted - 2008-02-14 : 10:02:36
thncxxx
Go to Top of Page
   

- Advertisement -