cancel
Showing results for 
Search instead for 
Did you mean: 

Open Invoices older than 180 Days

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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'