Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Sql Server Programming

Search or Find function?


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:

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...

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc