Want NULL value of date type column at last when ordering data in report

  • 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.

  • 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.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply