Although what I'm trying to do is more complicated than this, the
following sums up the problem.
I have a linked server which is an accountancy software package. This
contains the tables INVOICE and INVOICE_ITEM.
INVOICE consists of fields INVOICE_NUMBER, INVOICE_DATE,
INVOICE_ITEM consists of fields INVOICE_NUMBER, LINE_NUMBER, STOCK_CODE,
QUANTITY, SALES_PRICE etc
The two tables relate to each other on the INVOICE_NUMBER field.
Currently they both run from a low value to 81234.
The following query works. Correctly returning 7 records representing
all the lines on the 4 invoices:-
SELECT * FROM OpenQuery(SAGE_SERVER,'SELECT * FROM INVOICE_ITEM WHERE
INVOICE_NUMBER > ...