Link to home
Start Free TrialLog in
Avatar of maximus1974
maximus1974

asked on

How to place a delimiter using CONCAT

I need to place a pipe or vertical bar as shown below using the select statement also shown below:

1/1/2009|BLOCK AS PER CANCELLATION MEETING|6/21/2017

SELECT [SQL]
      ,[PNM_AUTO_KEY]
      ,CONCAT(ISNULL(CREATION_DATE,','),ISNULL(NOTES,''),ISNULL(BLOCKED_DATE, '')) AS NOTES
      ,[Blocked]
      ,[CAP_AUTO_KEY]
  FROM [QUANTUM_LIVE].[dbo].[MIN_MAX]

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you don't want to show the | if the value is null -- unsusual, but possible -- there's still not need for a CASE statement:

CONCAT( ISNULL(CREATION_DATE,','), '|' + NOTES, '|' + BLOCKED_DATE ) AS NOTES