Incorrect syntax near Order By

  • Last Post 27 February 2018 posted this 14 February 2018 - Last edited 14 February 2018


I craete a simple pie chart report, although I have chosen sort by in designer , when I get query back it's something like , which Order by column is ommited, how can I fix it? (I tried same with Bar chart it's same result)

SELECT Count([org].[Organization].[CountryId]) AS [Count of Country id], Count([org].[Organization].[Id]) AS [Count of Id]
FROM [org].[Organization] WITH (READUNCOMMITTED)




Converting same report to list works fine and this will be the query

SELECT [org].[Organization].[CountryId] AS [Country id], [org].[Organization].[Id] AS [Id]
FROM [org].[Organization] WITH (READUNCOMMITTED)


ORDER BY [org].[Organization].[CountryId]

admin posted this 27 February 2018

Hi Reza

This is an interesting issue. Can you put a break point in the "RunReport" method in the controller and see if the sql query comes back with Order By and if it's being dropped in the controller, or the service itself is returning it without the Order By clause. If needed, we can dig in to the Api logs to figure out what is going on, but I think the controller code might be incorrectly dropping the Order By clause.