Removing Nulls

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jschmidt
    New Member
    • Jun 2007
    • 47

    Removing Nulls

    Hello Everyone, I have a View that is returning null values. This is not a problem except that I don't want the user to see "NULL" in the data. I want to replace "NULL" with a blank. The sql that I have is shown below:

    SET QUOTED_IDENTIFI ER ON
    GO
    SET ANSI_NULLS ON
    GO
    ALTER VIEW dbo.CUSVW_SCHEM ATIC_DETAILS_VE NDOR
    AS
    SELECT [DIVISION], [DIVISION NAME], [STOCKING SECTION #], [STOCKING SECTION NAME],
    [FIXTURE], [SIZE], [STORE #], [AISLE NUMBER], [AISLE SIDE],
    [LEFT STOCKING SECTION #], [LEFT STOCKING SECTION NAME],
    [LEFT STOCKING SECTION SIZE], [RIGHT STOCKING SECTION #],
    [RIGHT STOCKING SECTION NAME], [RIGHT STOCKING SECTION SIZE]
    FROM [AVTP].[dbo].[CUSVW_SCHEMATIC _DETAILS]
    GO
    SET QUOTED_IDENTIFI ER OFF
    GO
    SET ANSI_NULLS ON
    GO

    How can I get the nulls to be blanks instead of "NULL"??

    Thanks!
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by jschmidt
    Hello Everyone, I have a View that is returning null values. This is not a problem except that I don't want the user to see "NULL" in the data. I want to replace "NULL" with a blank. The sql that I have is shown below:

    SET QUOTED_IDENTIFI ER ON
    GO
    SET ANSI_NULLS ON
    GO
    ALTER VIEW dbo.CUSVW_SCHEM ATIC_DETAILS_VE NDOR
    AS
    SELECT [DIVISION], [DIVISION NAME], [STOCKING SECTION #], [STOCKING SECTION NAME],
    [FIXTURE], [SIZE], [STORE #], [AISLE NUMBER], [AISLE SIDE],
    [LEFT STOCKING SECTION #], [LEFT STOCKING SECTION NAME],
    [LEFT STOCKING SECTION SIZE], [RIGHT STOCKING SECTION #],
    [RIGHT STOCKING SECTION NAME], [RIGHT STOCKING SECTION SIZE]
    FROM [AVTP].[dbo].[CUSVW_SCHEMATIC _DETAILS]
    GO
    SET QUOTED_IDENTIFI ER OFF
    GO
    SET ANSI_NULLS ON
    GO

    How can I get the nulls to be blanks instead of "NULL"??

    Thanks!
    try:

    SELECT isnull(DIVISION ,' ') as division....and so on...

    Comment

    • Taftheman
      New Member
      • Nov 2006
      • 93

      #3
      Try using case statements

      case when division is null then '' esle division end

      sort of thins, this need to be in the select statement

      Comment

      Working...