|  | Posted by Plamen Ratchev on 06/04/07 20:29 
You can use COALESCE, something like this will do it:
 COALESCE(P.ADDR1, '') + ' - ' + COALESCE(P.CITY, '') + ', ' +
 COALESCE(P.STATE, '') AS LOCATION
 
 Also, you can play with formatting variations based on what you want to get
 when one of the columns is NULL, like this:
 
 COALESCE(P.ADDR1, '') + COALESCE(' - ' + P.CITY, '') + COALESCE(', ' +
 P.STATE, '') AS LOCATION
 
 HTH,
 
 Plamen Ratchev
 http://www.SQLStudio.com
  Navigation: [Reply to this message] |