checking secondary field and replace null value

  • This is what i try to do

    in our database the second address field, if not used will display a null or else it will display address info.

    First, when i run my query i want to check if that field is populated with address info and then display it in my output but if it is null then that part of the query must be ignore, almost like an if statement.

    thanks for the help

  • SELECT

    CASE WHEN SecondAddress IS NULL THEN '' ELSE SecondAddress END

    FROM

    ......

  • ....or -

    select isnull(secondaddress,'') as secondadd_notnull ,

    ....

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Thank you...

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply