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.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-04-17 : 09:38:20
|
Rob writes "I'm using access '97 and one of the records in the database is a comma delimited text. In ASP what I want to do is run an SQL query to determine if a value is in the list. The SQL i've been trying is:SQL = "Select * From Email Where '"&SID&"'IN (MailID)" Set RS = MyConn.Execute(SQL)SID is equal to a number and MailID is the list in the database ie. 1, 2, 3, 4Thanks for your helpCheers" |
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2002-04-17 : 12:02:06
|
Rob, Access will let you use the contents of a column as the IN clause, but it works like this:SELECT field1 FROM Table1 WHERE 23 in (field2, field3, field4)It won't break down the contents of the column for you. You could solve this problem in a few ways:1. Have another table that holds the MailID's for all the Email records. This table would have 2 fields - the key for the Email table and the MailID field. Then you can just query this table in your ASP code. This option would be my preference. 2. Use the Access Instr function to search through the MailID column for the number you want. Be careful with this one - you'll need to be very sure about how the numbers are formatted in the column.Hope this helps |
 |
|
|
|
|