SELECT PATINDEX('%-%', field2check)
Eg:
if want to find the position of the '-' in categorycode - '2001-01'
SELECT PATINDEX('%-%', '2001-01')
Return value :5
Eg:
if want to find the position of the '-' in categorycode - '2001-01'
SELECT PATINDEX('%-%', '2001-01')
Return value :5
Comments