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.
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] |
 |
|
disha
Starting Member
34 Posts |
Posted - 2008-02-14 : 04:31:50
|
need help....in my senarioi 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 amountsif 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 ideasomething like ampersand @ in oracle which prompts users to enter any value |
 |
|
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. |
 |
|
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 senarioi 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 amountsif 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 intselect @rows = 20set rowcount @rowsselect * from yourtablewhere datecol >= @startdateand datecol <= @enddateorder by payments descset rowcount 0 KH[spoiler]Time is always against us[/spoiler] |
 |
|
disha
Starting Member
34 Posts |
Posted - 2008-02-14 : 10:02:36
|
thncxxx |
 |
|
|
|
|