Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: how to find maximum of a string
05-16-2014, 11:31 AM #1
- Join Date
- Feb 2014
- Thanked 0 Times in 0 Posts
how to find maximum of a string
I have in Table some values like
how to find the max of this value using asp.net.
I used query as select max(right(questid,2)) FROM [EMPFED].[dbo].[QUESTION] where subid='S1-13'
it displays as 10 its correct. but if table is
and then I use same as above query like select max(right(questid,2)) FROM [EMPFED].[dbo].[QUESTION] where subid='S1-13'
it displays -2
how to solve this. in asp.net .
Please help me
this is urgent
thank you all
05-17-2014, 02:28 AM #2
this is worded fairly confusing. Can you explain your table more? Are those varchar fields? is questId varchar and have those values of 's1-10-1' etc? I am assuming by your query that subId is varchar and equals 's1-13'