[thelist] Weird SELECT DISTINCT error

Ken Schaefer Ken at adOpenStatic.com
Thu Dec 15 16:24:03 CST 2005


http://www.adopenstatic.com/faq/800a0cc1.asp

If that doesn't solve the problem, please provide some code - the actual line
of code that is generating the error. The line where you build the SQL
statement is not going to generate that error - it's usually an error
generated by attempting to access a field of a recordset object.

Cheers
Ken

: -----Original Message-----
: From: thelist-bounces at lists.evolt.org [mailto:thelist-
: bounces at lists.evolt.org] On Behalf Of Casey
: Sent: Friday, 16 December 2005 7:39 AM
: To: The List
: Subject: [thelist] Weird SELECT DISTINCT error
: 
: This is odd.  If I use this query:
: 
: 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.



More information about the thelist mailing list