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)
 Query using IN...Reading Strings

Author  Topic 

streeves
Starting Member

3 Posts

Posted - 2003-09-09 : 19:09:15
Here's the dilema I have:

I have user who upload documents that are reference to a Customer and a Project Site for the Customer. When they upload the doc, they can reference the documents to Multiple Project Sites. My table has the following columns:

DocId - INT/IDENTIDY
ProjCustID - INT
ProjSiteID - VARCHAR

Here's my problem, I run a query of all the records to find the ones with a specific CustomerID, the I output a ValueList (using cold fuson) and then I run the following Query:

SELECT *
FROM ProjDocs
WHERE (projdocs_siteid IN (#resultList#))

Let's say resultList is = ('7', '18', '65', '66', '68')

When i run the Query, the only recrods it finds are ones where the ProjSiteID contains one value [7] for example.

If the ProjSiteID in a record contains multiple ProjSiteID's, i.e. [65,68,18,7], it will not return this record...

It is obviously not reading this string correctly and I've double checked the Output of my ValueList to see how it was returning the string..it is returning it as '65','68','18','7'

Any ideas? I'm stuck..I thought about adding a separate table to include the DocID and an INT column for the ProjSiteID and then just build an infinite number of records depending on how many Project Sites each document uploaded is referenced to.

Any help is GREATLY APPRECIATED!!!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-09-09 : 19:13:31
[url]http://www.sqlteam.com/item.asp?ItemID=11499[/url]

Does the above article help?

Tara
Go to Top of Page

streeves
Starting Member

3 Posts

Posted - 2003-09-09 : 19:18:16
Tara- gonna take a look at it..I was thinking initially of creating Array's but Store Procedure probably makes more sense..just scanned the article and it looks like it may be the way to go..I'll post back when I get it figured out
Go to Top of Page

streeves
Starting Member

3 Posts

Posted - 2003-09-09 : 19:38:49
Tara- gonna take a look at it..I was thinking initially of creating Array's but Store Procedure probably makes more sense..just scanned the article and it looks like it may be the way to go..I'll post back when I get it figured out
Go to Top of Page
   

- Advertisement -