General information
Forum:
Microsoft SQL Server
What am i doing wrong here
scanfilename = 'TB20111031GADO11FTB220181z220182.tif'
select scanfilename,CHARINDEX('O11FTB',scanfilename)+6 as pos_start,
CHARINDEX('tif',scanfilename) as pos_end,
(CHARINDEX('tif',scanfilename)-CHARINDEX('O11FTB',scanfilename)) as diff
from scans where scanfilename like '%O11FTB%'
produces
scanfilename pos_start pos_end diff
TB20111031GADO11FTB220181z220182.tif 20 34 20
why am I not getting 34 - 20 so answer 14
Thanks
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only