Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Sort by Date

Author  Topic 

michaelb
Yak Posting Veteran

69 Posts

Posted - 2008-07-02 : 19:35:17
I have a report in RS that I am trying to sort the results of the query in a table by date.

My SQL for the date is CONVERT(VARCHAR(8), t0.duedate, 3) as duedate
as I want dd/mm/yy. However this doesn't appear to be sorting properly in RS>
If I take away the conversion and leave it as natural datetime, its sorts fine.

How can I get it to sort properly as dd/mm/yy?

Thanks,
Michael

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-02 : 21:22:20
Order it by as-it-is DATETIME and let the report format the date

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-03 : 04:31:17
The order can even be done inside report itself in sorting tab of dataset or that of table. As suggested bring the date as it is and use it for sorting and while displaying format it using report function FormatDateTime or using standard format codes.
Go to Top of Page
   

- Advertisement -