var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Retriving Position In A Field
Is there a way to retrieve the position of a word, phrase or sign in a field?
For example, Field content is ABCDEFG1239/1002STJ
I would like to get the exact position of / which will be position 12.
The patindex function should work for you here. But, it will only give you the location of the first one. Syntax:
PATINDEX ( '%pattern%' , expression )
I wonder what he difference is?
SELECT PATINDEX ( '%/%' , 'ABCDEFG1239/1002STJ' )
SELECT CHARINDEX ( '/','ABCDEFG1239/1002STJ' )
PatIndex() allows SQL Server regular expressions. CharIndex() only allows literals.
Thank you for your reply. I couldn't thank of you earlier because I was away to Europe on a business trip.
I will try out your solutions today.
Once again. Thank you.