Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 checking against a comma separated list in one field

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-16 : 09:30:46
Ron writes "I have a database with one field that contains sometimes one and sometimes two email addresses, separated by a comma IF there are two. I need to have a dynamic select on this field so that if a user enters either of the email addresses the query returns data.

Here is my efforts so far:

SELECT Address, City, FirstName, LastName, Login, OverrideEmailAddress, Password, Phone, PhoneAlternate1, PhoneAlternate1AreaC, PhoneAlternate2, PhoneAlternate2AreaC, PhoneAreaCode, ReferredFrom, Salesperson, State, ZipCode FROM OptiGold WHERE (SUBSTRING(OverrideEmailAddress, 1, CHARINDEX(',', OverrideEmailAddress)) = '"&Request.Form("Email")&",') OR (SUBSTRING(OverrideEmailAddress, CHARINDEX(',', OverrideEmailAddress) + 1, LEN(OverrideEmailAddress)) = '"&Request.Form("Email")&"')"

Thanks in advance"
   

- Advertisement -