on 12-04-2007 5:58 PM
Hello,
I'm trying to retrieve the date an invoice was paid via a SQL stored procedure. I am working with the OINV table.
Thanks,
-Richard.
Richard,
The ORCT (Receipt table holds the date) and RCT2 table has the Invoice Numbers paid through that Receipt.
I have created a Query for you to get started.
Replace {Invoice Number} with your Invoice number. NOTE: As an Invoice could be paid through mutiple payments, the result of this query would be as many rows as the number of Payments. So please take the highest T1.DocDate.
SELECT T0.DocEntry AS 'Invoice Number', T1.DocNum AS 'Payment Number', T1.DocDate AS 'Payment Date', T1.CheckSum AS 'Check Amount' FROM [dbo].[RCT2] T0 INNER JOIN [dbo].[ORCT] T1 ON T1.DocNum = T0.DocNum INNER JOIN [dbo].[OINV] T2 ON T2.DocEntry = T0.DocEntry
WHERE T2.DocNum = {Invoice Number}
Suda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.