Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2003, 03:00 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default 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

 
Old October 10th, 2003, 03:05 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Sorry for my typos.

It should have read:

Anyone know why this doesn't work on an ASP page but does work in Query Analyzer?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Javscript works well in aspx page but fails... vivek_inos ASP.NET 1.0 and 1.1 Professional 2 June 18th, 2006 11:26 PM
Javascript Works Fine in Aspx page but... vivek_inos Javascript 0 June 14th, 2006 01:57 AM
Querying a textfile in QA daniel SQL Server 2000 10 February 1st, 2006 01:51 AM
.ASP login page fails offline, but works online ?? putte74 Classic ASP Basics 1 January 10th, 2006 07:21 PM
SQL QA Analyzer error Adam H-W SQL Server 2000 4 July 14th, 2005 05:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.