In the design view window under product group it is Group By Ascending. Which I think is correct - I want to group my data by Product Group and have it in ascending order. SQL code is as follows and is based on a union query which is STQ1 where the salesman
parameter is set.
SELECT PGT.kcode, PGT.descrip, Round(Sum([InvoicedTonnesThisYear]-[CreditedTonnesThisYear]),3) AS [Current Tonnes], Round(Sum([InvoicedTonnesLastYear]-[CreditedTonnesLastYear]),3) AS [Previous Tonnes], Round([Current Tonnes]-[Previous Tonnes],3) AS [Tonnes
Chg], IIf([Previous Tonnes]=0 And [Current Tonnes]>0,"100.00%",IIf([Tonnes Chg]=0,"No Tonnes",Format([Tonnes Chg]/[Previous Tonnes],"Percent"))) AS [Tonnes % Chg], Round(Sum([InvoicedUnitsThisYear]-[CreditedUnitsThisYear]),0) AS [Current Units], Round(Sum([InvoicedUnitsLastYear]-[CreditedUnitsLastYear]),0)
AS [Previous Units], [Current Units]-[Previous Units] AS [Units Chg], IIf([Previous Units]=0 And [Current Units]>0,"100.00%",IIf([Units Chg]=0,"No Units",Format([Units Chg]/[Previous Units],"Percent"))) AS [Units % Chg], FormatCurrency(Sum([InvoicedValueThisYear]-[CreditedValueThisYear]),0)
AS [Current Value], FormatCurrency(Sum([InvoicedValueLastYear]-[CreditedValueLastYear]),0) AS [Previous Value], FormatCurrency([Current Value]-[Previous Value],0) AS [Value Chg], IIf([Previous Value]=0 And [Current Value]>0,"100.00%",Format([Value Chg]/[Previous
Value],"Percent")) AS [Value % Chg], STQ1.name
FROM STQ1 INNER JOIN PGT ON STQ1.pgrp = PGT.kcode
GROUP BY PGT.kcode, PGT.descrip, STQ1.name
ORDER BY PGT.kcode;