Sort String Numeric Values ​​in SSRS 2008

I have a varchar field (I group) in a dataset that returns a list of values: 20, 25, 40, 100, 110, 'N / A' ..

I want the "numeric" values ​​to be sorted from low to high: ie: 20, 25 ... 110, "N / A"

the problem is that sorting A> Z in the group gives the following output:

100, 110, 25, ..., N / A

I cannot convert to a numeric data type, since there are string values.

Does anyone have a solution?

Thanks in advance Jam

+4
source share
1 answer

, . , . , , . , , , * num_text *.

SSRS: Tablix , , . . "". " " "" :

=CInt(IIF(Fields!num_text.value = "N/A",9999999,Fields!num_text.value))

: , /. 9999999 . , , /BIDS , #Error, , CInt ( , ) .

SQL: (, field_sort) case, , :

, Case
    When --Criteria leading to "N/A"
        Then 9999999
        Else num_text
    End as field_sort

--Rest of SQL Script here

Order by field_sort

num_text SSRS, . , SQL ( IIF SSRS.

+5

Source: https://habr.com/ru/post/1526186/


All Articles