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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL / Text Driver

Status
Not open for further replies.

chris5g

Programmer
Aug 21, 2001
48
US
I posted this in SQL programming but they thought I might haver better luck here. Also, the program works fine 90% of the time =). only every so often do I get this error...


I am reading from multiple CSV files that are exported from a program we use. Every once in a while I get this message and my program fails. Has anyone gotten this message before?

DB fields: title,Dauthor,collection,call,item#

Below is the error & description and the SQL statement.

Error: -2147217913 [Microsoft][ODBC Text Driver] The ORDER BY expression (Call) includes fields that are not selected by the query. Only those fields requested in the first query can be included in an ORDER BY expression.

SQL: SELECT * FROM 08apr2004.txt WHERE Collection <> 'sgov' AND Collection <> 'smac' Union SELECT * FROM 14apr2004.txt WHERE Collection <> 'sgov' AND Collection <> 'smac' ORDER BY Call ASC, Collection;
 
Could be null in one of those columns...may not always be there (like using 2 street address field, where most of the time the address format from your system fills out both, but onccasionaly there is only one)

Could test to ensure that nulls are handled or exported as empty strings ("")


Bastien

Cat, the other other white meat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top