Sale report arrangement

Hi, everyone

I just would like to do rearrange of the number of best sales, as shown on the picture on the right hand site. I want to arrange by DESC but I don’t know how to add this code into the syntax. anyone can do, please help me.

Thank you.

Your using SQL for your report… can you show your SQL Script?

Have you looked into using Report Tags instead of SQL?

http://www.sambapos.com/wiki/doku.php?id=custom_reporting_tags

The default Item Sales Report shows a good idea of how to use the Report Tags.

Thank for the answer, let me try and I’ll let you know.
Btw i’m not the person who setup this system, so I just come to take over of this system. :frowning:

Thank you

Hi, Kendash
Here my SQL code
also I try to use [Quantity] instead MenultemName at the bottom line, but It’s dose’t work.

SELECT [MenuItemName],[PortionName],CONVERT(INT,SUM([Quantity])) as Qty

FROM [Orders]

WHERE [CreatedDateTime] > ‘{Start}’ AND [CreatedDateTime] < ‘{End}’

GROUP BY [MenuItemName], [PortionName]

ORDER BY MenuItemName DESC

There is nothing wrong with that SQL code.

Of course that code will only work using a valid Workperiod(s), since it uses {Start} and {End} parameters which it gets from the Report Explorer date filters.

What are you trying to do exactly? And what does “doesn’t work” actually mean? No results? Mid-ordered results? Incorrect values?