Hi,
I've done this query and it is being used with the alert function to send out an e-mail everyday. I've learned that to get a subtotal you need to ctrl+click but is there no other way to get a subtotal to show in the result? Because ctrl+click is not possible when the report has been sent as an e-mail and often my colleagues read their e-mail on their phones.
I would only need a subtotal of the linetotal.
Also, I seem to be getting the right result, but is my date selection correct? The result should only show the previous days sales orders.
SELECT T0.[DocDate], T0.[DocNum], T0.[CardCode], T0.[CardName], SUM(T1.[LineTotal]) AS 'Totalt ex moms' FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry] WHERE T0.[DocDate] >= getdate()-2 AND T0.[DocDate] <= getdate()-1 GROUP BY T0.[DocDate], T0.[DocNum], T0.[CardCode], T0.[CardName]