Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2014
    Thanked 0 Times in 0 Posts

    how to find maximum of a string


    I have in Table some values like

    s1-10-1 s1-13
    s1-10-2 s1-13
    s1-10-13 s1-13

    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

    s1-10-1 s1-13
    s1-10-2 s1-13

    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


  2. #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Thanked 210 Times in 209 Posts
    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'

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts