Declare @FromDate NVARCHAR(50)='2016-2017'
Select SUBSTRING(@FromDate,LEN(@FromDate)-CHARINDEX('-',REVERSE(@FromDate)) + 2,LEN(@FromDate))
SELECT SUBSTRING(@FromDate,0,CHARINDEX('-',@FromDate))
Select SUBSTRING(@FromDate,LEN(@FromDate)-CHARINDEX('-',REVERSE(@FromDate)) + 2,LEN(@FromDate))
SELECT SUBSTRING(@FromDate,0,CHARINDEX('-',@FromDate))
No comments:
Post a Comment