Concatenation of Two Strings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pooja Joshi
    New Member
    • Feb 2012
    • 1

    Concatenation of Two Strings

    When i concate 2 string, if last string value is null than concatination string also null.
    Eg. Select fname +' '+ lname as [name] from employe.
    If 'lname' is null and 'fname' is pooja,than i am getting null in name field ,please help
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You can use the ISNULL function to change nulls into an empty string.
    Code:
    ISNULL(someField, '')

    Comment

    • shv214
      New Member
      • Apr 2012
      • 3

      #3
      You can use ISNULL(), NVL(), IFNULL() and COALESCE() Functions to set any default value like spaces if null is encountered
      Last edited by Niheel; May 2 '12, 11:40 AM. Reason: sorry no links, unless it's a reference

      Comment

      Working...