cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving Invoice Paid date

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member583013
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thank you for your help. That did it!

Answers (0)