Skip to Content
avatar image
Former Member

Open Invoices older than 180 Days

Hi All,

Required the list of Open Invoices order than 180 days with the following fields :

Doc No

BP Code

BP Name

Doc Total

Balance Due

Ocrcode (Location)

Thanks and Regards,

Arbaaz Khan.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 13, 2010 at 08:34 PM

    Try this:

    SELECT DISTINCT T0.DocNum, T0.DocDate, T0.CardCode, T0.CardName, T0.DocTotal, (T0.DocTotal - T0.PaidToDate) 'Balance Due', T1.Ocrcode

    FROM dbo.OINV T0

    INNER JOIN dbo.INV1 T1 ON T1.DocEntry = T0.DocEntry

    WHERE Datediff(dd, T0.docdate, Getdate()) > 180 AND T0.DocStatus = 'O'

    Thanks,

    Gordon

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 13, 2010 at 06:44 AM

    Try this query:

    SELECT DISTINCT T0.DocNum, T0.CardCode, T0.CardName, T0.DocTotal, T1.Ocrcode FROM OINV T0, INV1 T1

    WHERE T1.Docentry = T0.DocEntry

    AND Datediff(dd, T0.docdate,Getdate()) > 180

    AND T0.DocStatus = 'O'

    Add comment
    10|10000 characters needed characters exceeded