Skip to Content
author's profile photo Former Member
Former Member

Retrieving Invoice Paid date

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 10:32 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.