Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. CONCATENATION problem!!?? (SQL 2000)

CONCATENATION problem!!?? (SQL 2000)

Scheduled Pinned Locked Moved Database
helpdatabasequestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    anthoy
    wrote on last edited by
    #1

    help anyone!! phaleezz!! i just want to combine the returned values(both varchar types)of my two 'user defined function' as one field in my sql statement my codes like this.. select cast (UDF_getCellNos + '/' + UDF_GetLandLines as varchar(100)) as Contact_Info from tblCrewInfo if both my UDF's returns a value.. my column 'Contact_Info' returns '09179673815 / (02)9614337' works out fine.. but if either of my UDF's does not return a value... my column 'Contact_Info' returns 'null' it's supposed to return the value of the other UDF.. and thats my problem :doh: ..is there any other way i can get my UDF's returned values as one column, even if one doesn't have a return value? any help will be appreciated... thanks in advance

    P 1 Reply Last reply
    0
    • A anthoy

      help anyone!! phaleezz!! i just want to combine the returned values(both varchar types)of my two 'user defined function' as one field in my sql statement my codes like this.. select cast (UDF_getCellNos + '/' + UDF_GetLandLines as varchar(100)) as Contact_Info from tblCrewInfo if both my UDF's returns a value.. my column 'Contact_Info' returns '09179673815 / (02)9614337' works out fine.. but if either of my UDF's does not return a value... my column 'Contact_Info' returns 'null' it's supposed to return the value of the other UDF.. and thats my problem :doh: ..is there any other way i can get my UDF's returned values as one column, even if one doesn't have a return value? any help will be appreciated... thanks in advance

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      Concatenating a NULL value with a string will always return NULL. Use the ISNULL function to convert NULL values to empty strings to prevent this happening.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      A 1 Reply Last reply
      0
      • P pmarfleet

        Concatenating a NULL value with a string will always return NULL. Use the ISNULL function to convert NULL values to empty strings to prevent this happening.

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        A Offline
        A Offline
        anthoy
        wrote on last edited by
        #3

        woahhh you're a god man thanks for a fast reply thanks pmarfleet damn i really love this site!!

        P 1 Reply Last reply
        0
        • A anthoy

          woahhh you're a god man thanks for a fast reply thanks pmarfleet damn i really love this site!!

          P Offline
          P Offline
          pmarfleet
          wrote on last edited by
          #4

          anthoy wrote:

          damn i really love this site!!

          Yep, CodeProject rocks :)

          Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups