View Single Post
  #6 (permalink)  
Old July 18th, 2004, 03:55 PM
mircea mircea is offline
Registered User
 
Join Date: Jul 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I used your first example and I get this error:
--------
Microsoft OLE DB Provider for SQL Server (0x80040E07)
Syntax error converting the varchar value ',6100,5850,921,6497,' to a column of data type int.
--------


The output of the SQL looks like this:
-------
SELECT products.productid, products.Nr, products.Author, products.Title, products.Subtitle, products.Sonder, products.Price, products.Old_price, products.FilePath, products.FileName, products.featured FROM products WHERE products.Featured=1 and not_shown=0 and [productId] in (',6150,5867,1336,6575,') group by products.productid, products.Nr, products.Author, products.Title, products.Subtitle, products.Sonder, products.Price, products.Old_price, products.FilePath, products.FileName, products.featured
---------

As you see the "str" looks like (',6150,5867,1336,6575,')...this because of the string construction (the result is a string not a number).

So, first it seems I have to remove the first "," and the last...and after that converting to integer...

How do I do that?

Thanks,
Mircea
Reply With Quote