sql - Sorting in a matrix SSRS -


i try sort machine number ascending. if took out prduct description machines sorted ascending. show product description every machine , show machines sorted(m101,m102,m103...)

enter image description here

where date between @startdatetime , @enddatetime     , name in ('m101','m102','m103','m104','m105','m106','m107','m108','m109','m110', 'm111')      group date, name, productname      ) s  order name asc 

it should here:

enter image description here

enter image description here did used matrix

[![enter image description here][4]][4]

i have try these 2 solution

first use case when in order clause

order case          when name = 'm101' 1          when name = 'm102' 2     end  

it's not best solution it's can solved problem , second solution use substring in order clause this

order cast(substring(name,2,10) int) 

and if use column group dynamic expand column don't forget delete delete sorting condition. hope it's help


Comments

Popular posts from this blog

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -