Works in QA but not on ASP page
I have a query which has the following as part of the where statement:
or (ProdID = 'General' and OrderID not like '06%')
In QA it works correctly and does not pull the 'General' where 'OrderID not like '06%'.
Anyone know why this doesn't work on an ASP page but does work on the page?
It doesn't error it just pulls the information as if that part of the query was not present.
If I run this query in the query builder window for that table, I get an error message saying that 'CASE' is not supported, but, it does run the query and the result is correct. I'm thinking that may be part of the problem. I could build a stored procedure for this query and see if I get any better results.
This is the entire query:
strSQL = "SELECT * FROM SupportFAQ WHERE (Title <> 'Checklist') and Title <> 'ReqInfo' and " & xSql & " or (ProdID = 'General' and OrderID not like '06%') and status = '1' " & _
"ORDER BY " & _
" CASE " & _
" WHEN prodid = '" & strProdID & "' THEN 0 " & _
" WHEN prodid LIKE '" & strProdID & "%' THEN 1 " & _
" WHEN prodid LIKE '%" & strProdID & "%' THEN 2 " & _
" WHEN ProdID = 'Type II Routers' THEN 3 " & _
" WHEN Prodid = 'general networking' THEN 4 " & _
" WHEN Prodid = 'General VOIP' THEN 5 " & _
" WHEN prodid = 'general router' THEN 6 " & _
" WHEN prodid = 'General USB' THEN 7 " & _
" WHEN ProdID = 'General Wireless' THEN 8 " & _
" WHEN ProdID = 'General Adapters' THEN 9 " & _
" WHEN ProdID = 'General Print Server' THEN 10 " & _
" WHEN ProdID = 'General Switches' THEN 11 " & _
" WHEN ProdID = 'General Hubs' THEN 12 " & _
" WHEN prodid = 'zero knowledge freedom software' THEN 13 " & _
" WHEN prodid = 'General' THEN 14 " & _
" ELSE 15 " & _
" END, OrderID"
Thank you,
Richard Stelma
|