sql error I don't understand

sql error I don't understand

Post by Andy Sutoriu » Fri, 14 Jul 2000 04:00:00



Here's the error:
Microsoft OLE DB Provider for SQL Server error '80040e14'

ORDER BY items must appear in the select list if SELECT DISTINCT is
specified.

/wccasp/classes/fall/default_test.asp, line 87

Here's the select statement....can you tell me how I can ORDER it so I don't
get this error?

sqlID = "SELECT distinct q=Col001+''+Col002+''+Col003 FROM fall WHERE
len(Col001+''+Col002+''+Col003)<>0 AND Col001='" & (Abbreviation) & "' ORDER
BY Col001, Col002, Col003"
--
Andy Sutorius

 
 
 

sql error I don't understand

Post by Chris Smit » Fri, 14 Jul 2000 04:00:00


Try this:

sqlID = "SELECT distinct q=Col001+''+Col002+''+Col003 FROM fall WHERE
len(Col001+''+Col002+''+Col003)<>0 AND Col001='" & (Abbreviation) & "' ORDER
BY Col001+''+Col002+''+Col003"

--
Chris Smith
MS SQL Sever DBA


> Here's the error:
> Microsoft OLE DB Provider for SQL Server error '80040e14'

> ORDER BY items must appear in the select list if SELECT DISTINCT is
> specified.

> /wccasp/classes/fall/default_test.asp, line 87

> Here's the select statement....can you tell me how I can ORDER it so I
don't
> get this error?

> sqlID = "SELECT distinct q=Col001+''+Col002+''+Col003 FROM fall WHERE
> len(Col001+''+Col002+''+Col003)<>0 AND Col001='" & (Abbreviation) & "'
ORDER
> BY Col001, Col002, Col003"
> --
> Andy Sutorius



 
 
 

1. don't understand sproc error message

See sql below:

create proc dbo.x2
as
begin tran second




        begin
                print '4 does not equal 5'
                rollback tran second
        end
commit tran second
go
------------------------
create proc dbo.x1
as
begin tran x

exec dbo.x2

commit tran x
go
-----------------------------
exec dbo.x1

why do I get error message
Server: Msg 6401, Level 16, State 1, Procedure x2, Line 10
Cannot roll back second. No transaction or savepoint of that name was found.

what am I not understanding??

thanks
AP

2. Compiler warnings: sybfront.h & Xmd.h

3. Error with select statement I don't understand

4. Good Book For VFP

5. Getting Error 13, help - don't understand why

6. SQL Attachments?

7. An Oracle Error I don't understand.

8. Concurrent Use of Ingres

9. Don't understand ora-01789 error

10. SQL server goes down, don't understand errorlog

11. SQL 7.0 Triggers- COLUMNS_UPDATED() Don't understand bitmask

12. Help, I am a programmer and don't understand SQL/NT admin

13. Help: SO get's hidden and I don't understand why