Hello Gordon,
Many thanks for your reply and query. Unfortunately when I try and run that query it returns the following error:
1). [Microsoft][SQL Server Native Client 10.0][SQL Server]'AMX' is not a recognized built-in function name. 2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near '1st Order DocTotal'. 3). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'Count'. 4). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'Sum of Basic'. 5). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'group'. 6). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement 'User-Defined Values' (CSHS) (s) could not be prepared.
Thanks again
Regards
Graham