Subject Re: [IBO] column list & variable list do not match (SOLVED)
Author Ryan Nilsson-Harding
OK,
solved.

Thanks you both Helen & Jason for your suggestions, from these I've
finally figured the problem.

Following Jasons suggestion of using the client trace, I found that
once the report was about to display the results the query was being
changed to:

SELECT COUNT(*)
FROM PTI
...
...
UNION
SELECT BD_ID AS ID, ...

etc,
So at least now I could SEE how the two sets were different, but why
was my query being changed from two identical, explicitly created sets
to one containing COUNT(*)?

The property TIBQuery.RecordCountAccurate was the culprit.

I've NEVER used that property, and checking now I see that this
property is true by default.

Any chance someone can explain why this happens though.
I mean, I have no code which asks for a RecordCount, so even though
that property is true, why would it even be trying to calculate the
count, and thereby silently screwing around with the statement I pass it?

Oh well, many hours lost but many quirks learnt

Thanks again, Helen & Jason
Rgds,
-Ryan