Subject error when adding "ORDER BY"
Author Andrew Guts
I have Delphi 5 & BDE application .
There is initial query :

select id, office,
(select sum(duration) from clog cl where cl.o_id = o.id and cl.cldate
between :D1 and :D2 ) as sum_sec
from offices o

Parameters D1 and D2 are timestamps.
"id" is a primary key of "offices" table (integer)

It works well till "ORDER BY # [DESC]" clause is added at runtime.
"order by 1" and "order by 2" work well. But "order by 3" causes error
"wrong XSQLDA version" and application can not operate further if
running with BDE Interbase driver. When running with INTERSOLV ODBC
driver "order by 3" kills application immediatelly in spite of catching
any exception. The same application works wihout any errors with MS SQL
server.

How to solve this problem?

Andrew