[thelist] Weird SELECT DISTINCT error

Jay Blanchard jay.blanchard at THERMON.com
Thu Dec 15 14:47:28 CST 2005


[snip]
SELECT DISTINCT policy_name FROM vwOpp_with_Sale WHERE producer_id = 329 AND

active_code = 1

Then I am told "Item cannot be found in the collection corresponding to the 
requested name or ordinal."

But if I use this query:

SELECT DISTINCT opp_id,policy_name FROM vwOpp_with_Sale WHERE producer_id = 
329 AND active_code = 1

Then the query executes just fine.  What's more, if I execute the first 
query directly at the table within SQL's Enterprise Manager, it works just 
fine.  What gives here?  The ONLY difference between the first and second is

the inclusion of "opp_id," - which should not make a lick  of difference. 
Right?

Classic ASP with MS SQL.
[/snip]

Can you show us the code section where the query is? At the very least you
need to echo the query itself out to the browser window as text. Any obvious
problem will be visible.



More information about the thelist mailing list