Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to find maximum of a string

    Hi

    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


    shubha

  • #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,776
    Thanks
    41
    Thanked 196 Times in 195 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
    •