Instr function for MSQL query

SELECT PATINDEX('%-%', field2check)

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

Return value :5

Comments