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;
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;