Skip to Content
0
Former Member
Mar 11, 2010 at 07:23 AM

Tot invoice

110 Views

Good Afternoon hallow experts

I have this query, is there anything that can help me to show sum TOT invoices

This view my Query:

SELECT

T0.[CardCode], T0.[CardName], T1.[PymntGroup]as 'TOP',

T2.[DocDueDate]as 'INV Due Date', sum(T2.[DocDueDate])as 'TOT Inv Due Date'

T2.[DocTotal] as ' INVOICE',sum(T2.[DocTotal])as 'Tot Invoice',

T3.[DocDate]as 'Payment Date', T3.[DocDueDate]as'Payment Due Date',

T3.[DocTotal] as 'TOT Payment'

FROM

OCRD T0 INNER JOIN OCTG T1 ON T0.GroupNum = T1.GroupNum INNER JOIN

OINV T2 ON T0.CardCode = T2.CardCode INNER JOIN ORCT T3 ON T2.ReceiptNum = T3.DocEntry

WHERE

Month(T0.DocDate) = Month(GetDate()) AND Year(T0.DocDate) = Year(GetDate())

T2.[DocDate] >=[%0] and

T2.[DocDate] <=[%1]

want to display like this:

Code, customer name, TOP, INV Due Date, TOT inv Due Date, Invoice, TOT invoice , Payment date,Payment Due Date,TOT Payment

Thx