Tuesday, July 19, 2016

Access InStr() function to SQL Server equivalent


What is the SQL Server equivalent to Access InStr() function?

TargetField: String expression being searched
SearchValue: String expression being sought
StartPosition: Starting position for each search (optional)
  • InStr(TargetField, SearchValue)
  • InStr(StartPosition, TargetField, SearchValue)
SQL Server
  • CHARINDEX(SearchValue, TargetField)
  • CHARINDEX(SearchValue, TargetField, StartPosition )

No comments: