Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select distinct from jet to t-sql gives error #145

Status
Not open for further replies.

Pampers

Technical User
Apr 7, 2004
1,300
AN
Hi Folks,
I upsized my database tables to MsSql2000. Works ok. Except for a subform with a Select Distinct in it. It gives the error message: "Server: Msg 145, ORDER BY items must appear in the select list if SELECT DISTINCT is specified." But there is no Order By clause in the query. The query runs ok (in dataview), but when I open the subform which has its control source set to the query, the error message appears. The [order by] and [order by on]-properties of the subform are resp Null and off. Any ideas who to correct this?

This is the query:
Code:
SELECT DISTINCT tblOperations.operationsID, tblOperations.FileNumber, tblOperations.ETC, tblOperations.ETCDate, tblOperations.ETCTime, tblOperations.ETD, tblOperations.ETDDate, tblOperations.ETDTime, tblOperations.ETDRemark, tblOperations.[Next Port], tblOperations.[ETA next port d], tblOperations.[ETA next port t]
FROM tblOperations;



Pampers [afro]
Just back from holiday...
that may it explain it.
 
This is very much an uninformed guess, is there an OrderBy on the subform itself? That is, the Order By property?
 
Hi Remou,
Yes there is.
The [order by] and [order by on]-properties of the subform are resp Null and off.

Pampers [afro]
Just back from holiday...
that may it explain it.
 
By the way, I think it would be better to move my question to the Microsoft MsSql forum...

Pampers [afro]
Just back from holiday...
that may it explain it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top