Monday, 3 July 2017

Split String With Special Character in Sql

Declare @FromDate NVARCHAR(50)='2016-2017'
Select  SUBSTRING(@FromDate,LEN(@FromDate)-CHARINDEX('-',REVERSE(@FromDate)) + 2,LEN(@FromDate))
SELECT SUBSTRING(@FromDate,0,CHARINDEX('-',@FromDate))

No comments:

Post a Comment

React Hooks - custom Hook

  v CustomHook Ø React allows us to create our own hook which is known as custom hook. Example – 1 localStorage Demo Step-1 Create ...