Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Want NULL value of date type column at last when ordering data in report Expand / Collapse
Author
Message
Posted Friday, June 14, 2013 7:29 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, January 21, 2014 4:18 AM
Points: 11, Visits: 89
Hi,
I am using SSRS 2008 R2. Dataset has date field "MyDate". "MyDate" field contains NULL(nothing) values. I am doing sorting on different fields. I am able to sort data with "MyDate" fields also.
Issue : I want Null(Nothing) data at end of list for "MyDate" field sorting. How it will possible. Order
Please provide me solution if anyone have.
Post #1463563
Posted Friday, June 14, 2013 7:46 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 12:31 PM
Points: 345, Visits: 2,219
Off the top of my head...

In the ORDER BY clause, immediately before the 'MyDate' column, add this CASE statement:

CASE WHEN MyDate IS NOT NULL THEN 1 ELSE 2 END

That will cause the non-null entries to be returned first, followed by the null entries.



Post #1463574
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse