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 2008 Forums
 Analysis Server and Reporting Services (2008)
 sort by time in SSRS

Author  Topic 

sanghavi17389
Starting Member

26 Posts

Posted - 2012-05-21 : 09:30:49
I made a report in SSRS.
One of my fields is Request time which has datetime type.
All data are of same date but time is different.
I need to sort by datetime.

how can i do it?


harshal sanghavi

shilpash
Posting Yak Master

103 Posts

Posted - 2012-05-21 : 11:08:44
Can you list sample data how it is and also list the data in the format you want.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-05-21 : 16:12:45
quote:
Originally posted by sanghavi17389

I made a report in SSRS.
One of my fields is Request time which has datetime type.
All data are of same date but time is different.
I need to sort by datetime.

how can i do it?


harshal sanghavi


so far as datatype is datetime you can simply add column under sorting property of container to get container sorted based on it. In case its not getting sorted in correct sequence, try explicitly making type as date using CDate() function in sorting expression

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Cowski
Starting Member

30 Posts

Posted - 2014-12-09 : 15:33:41
I'm running into this very same issue. I've sorted by the Completiondate which is a DateTime type. In SQL Studio it sorts fine. In SSRS, it gets "confused".
This is what I've tried:
  • CDate(value)
  • Adding a Sort expression on that column
  • Putting a Order by in the sql code


Here is a listing of how it looks currently in SSRS:
(I want to sort by second column)

Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-12-09 : 15:46:48
ssrs doesn't reorder the data unless you tell it to. Remove all sorting from SSRS and leave in the query.
Go to Top of Page
   

- Advertisement -