Select Distinct Problem 
Author Message
 Select Distinct Problem

Here is my problem, in my database, lets say I have the following data.  The
underscores(_) are spaces.

fieldCode
001
001
001

fieldDescription
Computers_Desktop
Computers_Desktop
Computers_Desktop_________________

Using SQL 6.5 Enterprise manager, I do the following query...

"SELECT DISTINCT fieldCode, fieldDescription WHERE fieldCode = '001'"

and it yields this result...

001, Computers_Desktop

This is what I want.  But when I do it from an ASP using VBScript and an
ODBC connection, I get the following...

001, Computers_Desktop
001, Computers_Desktop_________________

I get Computers_Desktop listed twice when I only want it once.  It sees
trailing spaces as part of the data which makes it distinct where SQL
Enterprise Manager doesn't.  This is causing a real problem.  Can anyone
tell me how to get around it without modifying the data in the database?
Which has the error, vbScript and ODBC or SQL Manager?


Thanks in advance.

Craig Kohtz
http://www.*-*-*.com/



Sun, 11 Nov 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Select Distinct problem

2. Select Distinct problem from VB

3. SELECT DISTINCT problem (adVarWChar VS. adLongVarChar)

4. SELECT DISTINCT and memo field problem?

5. Problem using SELECT DISTINCT

6. Problem with Memo field in SELECT DISTINCT queries

7. SELECT DISTINCT yields more than SELECT

8. Change SELECT to SELECT DISTINCT?

9. SELECT works, but SELECT DISTINCT fails

10. VB select distinct Fax, Co_nam from tableA doesn't

11. Selecting TEXT as DISTINCT

12. Does Access support SELECT Count(DISTINCT fieldname) ...

 

 
Powered by phpBB® Forum Software