Hi all
still havin problems...
I am using the following SQL
SELECT DISTINCTROW Format$(SalesPersonPotentialBG.[Quotation Date],'yyyy mmmm') AS [Date By Month], (Sum(Nz(SalesPersonPotentialBG.calculatedtotal1,0))+Sum(Nz(SalesPersonPotentialBG.calculatedtotal2,0))+Sum(Nz(SalesPersonPotentialBG.calculatedtotal,0))) AS [Sum USD]
FROM SalesPersonPotentialBG
GROUP BY Format$(SalesPersonPotentialBG.[Quotation Date],'yyyy mmmm'), Year(SalesPersonPotentialBG.[Quotation Date])*12+DatePart('m',SalesPersonPotentialBG.[Quotation Date])-1
ORDER BY Format$(SalesPersonPotentialBG.[Quotation Date],'yyyy mmmm');
which orders correctly with year but alphabetically on month, so i tried to change order by to yyyymmdd, in order to order correctly but i get the following message, am i missing some code...
"
tried to execute query that does not include specified expression 'Formats$(SalesPersonPotentialBG.[Quotation D
Date],'yyyymmdd')' as aggregate function.
"
Thanks
Ali
still havin problems...
I am using the following SQL
SELECT DISTINCTROW Format$(SalesPersonPotentialBG.[Quotation Date],'yyyy mmmm') AS [Date By Month], (Sum(Nz(SalesPersonPotentialBG.calculatedtotal1,0))+Sum(Nz(SalesPersonPotentialBG.calculatedtotal2,0))+Sum(Nz(SalesPersonPotentialBG.calculatedtotal,0))) AS [Sum USD]
FROM SalesPersonPotentialBG
GROUP BY Format$(SalesPersonPotentialBG.[Quotation Date],'yyyy mmmm'), Year(SalesPersonPotentialBG.[Quotation Date])*12+DatePart('m',SalesPersonPotentialBG.[Quotation Date])-1
ORDER BY Format$(SalesPersonPotentialBG.[Quotation Date],'yyyy mmmm');
which orders correctly with year but alphabetically on month, so i tried to change order by to yyyymmdd, in order to order correctly but i get the following message, am i missing some code...
"
tried to execute query that does not include specified expression 'Formats$(SalesPersonPotentialBG.[Quotation D
Date],'yyyymmdd')' as aggregate function.
"
Thanks
Ali