Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSRS tablix Sorting not working on Date column

I have a SSRS report one

Stock#_______Description_____Colum1_____Colum2_____Colum3 ABC__________XYZ_____________4334________4354_______454

detail part 

Transaction#_______Date
1__________________yyyy/MM/dd } Need to be sorted
2__________________yyyy/MM/dd } this date column
3__________________yyyy/MM/dd } but always comes unsorted
4__________________yyyy/MM/dd } Note: (This is tablix)

So one line for master and in detail part showing 4 last recent records. And this is not sub-report. I am getting 4 rows, then grouping by stock# and used tablix to display 4 transactions sorted by recent date (desc). Did every effort but its not showing date in any order. Checked the dataset value, its completely in desc order by date, but reports is not arranging it somehow. Sending date as date, displaying it using Format("yyyy/MM/dd") SSRS function. Sorting using simple date value from dataset. What else I should do here?

like image 806
Builder Avatar asked Feb 09 '15 17:02

Builder


1 Answers

Since I got here from Google, I thought I'd add something that worked for me...

In my case the date field was coming from the database as a VARCHAR2 and not a DATE. One solution is to convert to a DATE in the query, but you can also convert the field to a date in the Interactive Sorting expression:

Context Click -> Textbox Properties -> Interactive Sorting -> Sort by:

Then enter an expression like this:

=CDate(Fields!DateField.Value)

This method does not change the visual format of the field, it simply sorts the field as a date instead of a string.

like image 185
McGlothlin Avatar answered Nov 03 '22 00:11

McGlothlin