Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Know how to delimit data in SQL? 1

Status
Not open for further replies.

psimon88

IS-IT--Management
Jul 21, 2005
66
US


example: abc@abc.com
ZZZm98@hotmail.com

I'd like to extract the characters afteer the "@" but I can't use right () because the len varies.

Any ideas?

 
Sure?

[tt]right$(mystring, instr(mystring, "@")+1)[/tt]

Roy-Vidar
 
Thank you.

You'd think that that's it, right?

'instr' is not a recognized function name.

SQL Analyzer running off SQL Server 2000.

Instead, I got it with this:

right(stremail,(LEN(strEMail)-CHARINDEX('@', strEMail))) as 'domain'
 
RoyVidar... you're using VB syntax in an MS SQL Server environment. These are ADPs being talked about.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top