Rows should be Ascending order in SSRS

Shanvitha 221 Reputation points
2020-12-08T09:10:48.67+00:00

Hi SSRS team,

I need Row wise accending order I have try my query side but still didnt coming Ascding order
COMPANY_NAME column value only 3

please help

my querys

Select * from F_COMPANY
WHERE FYEAR =@Year and FMONTH =@Month_Name

order by (CASE when COMPANY_NAME='Ab' THEN 1
WHEN COMPANY_NAME='Vot' THEN 2
WHEN COMPANY_NAME='Vote' THEN 3
ELSE 4 END) ASC

thanks
Shanvitha

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,793 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,551 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 40,656 Reputation points
    2020-12-08T10:27:50.337+00:00

    Which control are you using in the SSRS report, a table or a matrix (tablix)? A matrix order the data on it's own to aggregate the data, here you have to define the sort order in the matrix control.


  2. ZoeHui-MSFT 32,506 Reputation points
    2020-12-09T01:35:40.953+00:00

    Hi @Shanvitha

    I tested locally, there is noting wrong with the query.

    With the SSRS report table, everything goes well.

    The COMPANY_NAME column is ascending order.

    Please make a double check of your data and settings.

    It would be great if you could provide a minimal reproducible such as DDL and sample data population, i.e. CREATE table(s) plus INSERT, T-SQL statements.

    Regards,
    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    What can I do if my transaction log is full?--- Hot issues November

    How to convert Profiler trace into a SQL Server table -- Hot issues November