I have table with data 1/1
to 1/20
in one column. I want the value 1 to 20 i.e value after \'/\'(front slash) is updated into other column in same
Maybe something like this:
First some test data:
DECLARE @tbl TABLE(Column1 VARCHAR(100))
INSERT INTO @tbl
SELECT '1/1' UNION ALL
SELECT '1/20' UNION ALL
SELECT '1/2'
Then like this:
SELECT
SUBSTRING(tbl.Column1,CHARINDEX('/',tbl.Column1)+1,LEN(tbl.Column1))
FROM
@tbl AS tbl
SELECT SUBSTRING(ParentBGBU,0,CHARINDEX('-',ParentBGBU,0)) FROM dbo.tblHCMMaster;