Is there a function I can use to search for a text string within another text
string? For example:
search("-","1234-5678")
Would return 5 because "-" is found in the 5th position of "1234-5678"
Thanks,
--
Regards,
Dave
On Jun 6, 10:05 pm, David Billigmeier <dtbil
@hotmail.com> wrote:
> Is there a function I can use to search for a text string within another text
> string? For example:
> search("-","1234-5678")
> Would return 5 because "-" is found in the 5th position of "1234-5678"
> Thanks,
> --
> Regards,
> Dave
select charindex ('-','1234-5678',0)
Look at BOL for charindex function for more details
Thanks and Regards
Amish Shah
http://shahamishm.tripod.com
-----------------------------------------------Reply-----------------------------------------------
http://msdn2.microsoft.com/en-us/library/ms186323.aspx Cheers,
Jason Lepack
On Jun 6, 1:05 pm, David Billigmeier <dtbil@hotmail.com> wrote:
> Is there a function I can use to search for a text string within another text
> string? For example:
> search("-","1234-5678")
> Would return 5 because "-" is found in the 5th position of "1234-5678"
> Thanks,
> --
> Regards,
> Dave
Hi,
CHARINDEX.
see book online
--
Vt
Knowledge is power;Share it
http://oneplace4sql.blogspot.com
"David Billigmeier" <dtbil
@hotmail.com> wrote in message
news:06ACA8B3-3569-459E-B93F-9151AE88DD2F@microsoft.com...
> Is there a function I can use to search for a text string within another
> text
> string? For example:
> search("-","1234-5678")
> Would return 5 because "-" is found in the 5th position of "1234-5678"
> Thanks,
> --
> Regards,
> Dave