View Single Post
  #7 (permalink)  
Old July 18th, 2004, 11:27 PM
happygv happygv is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Mircea,

There seems to be some problem with the way you concatenate productid into str
str = str & rsprod("productid") & ","
You shouldn't have , at the beginning and end of that(6150,5867,1336,6575). Also don't wrap them around with single QUOTES. You got to code it in such a way that when the str is empty, just store the product ID there. If not empty then concat that with comma followed by product ID
Code:
If len(trim(str))=0 then
    str = rsprod("productid")
Else
    str = str & "," & rsprod("productid")
End IF
This way you would get that as 6150,5867,1336,6575

Try this query directly on your DB and see if that produces the required result and then proceed further.
Code:
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
Hope that explains.
Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote