Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Location
    India,Mumbai
    Posts
    34

    Unanswered: character function

    Hi All,
    What is the character function to get display first character in capital letter for a particular string value.
    as we have UPPER (convert in upper case) and LOWER(convert in lower case) functions in Sybase.

    Thanks

  2. #2
    Join Date
    Aug 2010
    Posts
    8

    functions

    you might try using a combination of the subtring + upper function.
    I am sure there is a faster way, but this works for me.

    example
    create table #X
    (row varchar(100))
    go
    insert #X select 'abcdef'
    go
    select upper(substring (row,1,1))+substring(row,2,99) from #X


    result set = Abcded

  3. #3
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    This should do the trick:
    Code:
    select upper(substring(@str, 1, 1))+lower(substring(@str, 2, char_length(@str)))
    where @str is the sting you want to transform.
    It's not one single function, but still pretty compact.
    I'm not crazy, I'm an aeroplane!

Posting Permissions

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