Skip to Content

Totalling values within a query

Hi all. I have the following query which is great for us, detailing all accounts that have been opened within a specified period and their relevant sales. However, I would like (if possible) to group the Business Partner individual invoice totals together and display as one value determined by the period selected.

Is such a thing possible?

SELECT T1.[CardCode] AS 'Customer/Supplier No.', T1.[CardName] AS 'Customer/Supplier Name', T1.[DocDate] AS 'Posting Date', T1.[DocTotal] AS 'Document Total', T0.[SlpName] AS 'Sales Employee Name', T2.[U_IIS_DAO] AS ' Date Account Opened'

FROM [dbo].[OSLP] T0 INNER JOIN [dbo].[OINV] T1 ON T1.[SlpCode] = T0.[SlpCode] INNER JOIN [dbo].[OCRD] T2 ON T2.[CardCode] = T1.[CardCode]

WHERE T2.[U_IIS_DAO]>='[%0]' and T2.[U_IIS_DAO]<='[%1]'

ORDER BY T0.SlpName, T1.CardCode



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers