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

Daily Outgoing Payment Report

Hello,

We have a Query shown below that allows us to view Incoming payments made each day to an invoice.

SELECT T2.CardCode [BP Acct#], T2.CardName [BP Company Name], T2.DocNum [Invoice #], T1.DocDate [Receipt Date], T2.DocTotal [Invoice Sum], T0.DcntSum, T0.SumApplied AS 'Paid to Invoice' 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 T1.DocDate = '[%0]'

We would like to modify this query so that the last column of information shows the Outgoing payments made. Meaning, any amount of money that we owe a customer and therefore apply to their outstanding invoice or as a credit memo, etc.

Can someone show us how to do this modification?

Thanks!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 24, 2008 at 06:17 PM

    Mike,

    Try this, this is your query, and it works perfect on my DB

    1) SELECT T2.CardCode BP, T2.CardName CompanyName, T2.DocNum Invoice, T1.DocDate ReceiptDate, T2.DocTotal InvoiceSum, T0.DcntSum, T0.SumApplied AS 'Credit to Invoice'

    FROM dbo.VPM2 T0 INNER JOIN dbo.OVPM T1 ON T1.DocNum = T0.DocNum INNER JOIN dbo.OPCH T2 ON T2.DocEntry = T0.DocEntry

    if this query give you results, the problem could it be in the WHERE clause "where T0.DocDate = '[%0]'

    Because you are not inserting a valid value in the '[%0]', maybe you are writing a date that doesnt existe in the "Existing Values" buttom.

    Slds,.

    Esteban Martinez

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 01:00 AM

    Hi Mike,

    You can copy that query and change the table name contain "RCT" to "VPM and "INV" to "PCH". The description of each field should be changed accordingly.

    Gordon

    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.