Skip to Content
0

Totalling values within a query

Nov 01, 2016 at 03:02 PM

25

avatar image

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

Regards

Roy

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers