| Author |
Topic |
|
renjithgr
Starting Member
7 Posts |
Posted - 2008-09-18 : 02:48:14
|
| Can anybody help me that for different select options as follows___ Name___ Age___ Address___ Placehow I will arrange this in sort order according to user enters and which i need to select from a database file.Like select * from table where conditions order by ???????????How I can handle this situation?Regards,Renjith |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-18 : 03:37:45
|
| [code]select * from table where conditions order by case when @sort='Name' then Name when @sort='Address' then Address when @sort='Place' then Place... end[/code] |
 |
|
|
renjithgr
Starting Member
7 Posts |
Posted - 2008-09-18 : 03:45:10
|
| It is not working. The @sort is need to define and to compare with file fields. So if I select 1 on name, 2 on address, 3 on age and 4 on place it will not sort accordingly.Where to define @sort also..If I am wrong please correct me? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-09-18 : 03:46:55
|
quote: Originally posted by renjithgr It is not working. The @sort is need to define and to compare with file fields. So if I select 1 on name, 2 on address, 3 on age and 4 on place it will not sort accordingly.Where to define @sort also..If I am wrong please correct me?
can you post your query here ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
renjithgr
Starting Member
7 Posts |
Posted - 2008-09-18 : 03:50:37
|
| Here the name, address,age and place are screen fields. Table fields are tname, taddress,tage and tplace. So if I need to sort these field in different order according to the user enters in different time. Can u guide me to resolve this? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-18 : 03:54:06
|
quote: Originally posted by renjithgr Here the name, address,age and place are screen fields. Table fields are tname, taddress,tage and tplace. So if I need to sort these field in different order according to the user enters in different time. Can u guide me to resolve this?
what will you be passing as values while selecting sort column? will it be numeric values like 1,2,.. or screennames like name,address,age,.. |
 |
|
|
renjithgr
Starting Member
7 Posts |
Posted - 2008-09-18 : 05:12:03
|
| The sort column values will be nuemeric like 1,2,3 etc |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|