Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Posts
    223

    How to display blank?

    Hello, everyone:

    By default, SQL Server display "NULL" if there is no data value. How to display blank instead of "NULL"? Thanks a lot.

    ZYT

  2. #2
    Join Date
    Nov 2003
    Posts
    94
    Assuming the [value] to be a character type:

    ISNULL( [VALUE], '' )

    You may have to cast non-chars to be chars. 'Blank' can never be a valid numeric but

    ISNULL( [VALUE], 0 )

    may hit the spot.

  3. #3
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    COALESCE
    Returns the first nonnull expression among its arguments.

    Syntax
    COALESCE ( expression [ ,...n ] )

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,576
    Simple solutions, but this is a formatting issue that is best left to your interface to handle. Both of these solutions display correctly by changing the actual value returned from a NULL to an empty string. NULLs and zero-length strings are very different data values, and may be interpreted differently by whatever reporting interface is receiving the result set.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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