Hey Bredlee,
I had a simular problem here @the job and if you don't need the data in the check amount you can just do a view in the SQL with a distinct on the invoice number
SELECT DISTINCT invoice FROM RM30201
This would select the every invoice number only 1 time
If you need the info from the check and you need or the highest or the lowest you can use:
SELECT TOP 100 PERCENT x.h_document, x.h_user, x.RecCount
FROM (SELECT h_document, h_user, COUNT(*) AS RecCount
FROM dbo.hissto
GROUP BY h_document, h_user) x INNER JOIN
(SELECT h_document, MIN(RecCount) AS RecCount
FROM (SELECT h_document, h_user, COUNT(*) AS RecCount
FROM dbo.hissto
GROUP BY h_document, h_user) y
GROUP BY h_document) z ON x.RecCount = z.RecCount AND x.h_document = z.h_document
you will have to change the field info (as this is a copy paste from mine witch is invoice and user (sales person) just change document -> you invoice field and user -> check
you can change the MIN (recCount ) to MAX if you need the highest check amount
ps: a friend of mine wrote this in MSSQL but don't ask me to explain :p
Hope this helps you a bit
Greetings
Adam