LearnItFirst User Forum

New SQL Server 2008 DBA Course
Welcome Guest Search | New Posts | Members | Log In | Register

Sort order of NULL values in report Options
jsaling
Posted: Thursday, July 23, 2009 11:11:50 AM
Rank: Newbie

Joined: 7/23/2009
Posts: 2
Points: 6
Where do you live?: MA, USA
I have a date field in a SQL Server Report created in MS Visual Studio and being run against what I believe is a SQL 2000 server.

The database is remote and I only have access to the Report Manager server to upload and run reports. The report xmlns has to be changed from ../2005/01/reportdefinition to ../2003/10/reportdefinition before it will run.

The date field has some NULL values.

I am trying to sort ascending but the NULL values come first.

How do I get the NULL values to come last in the sort?

I have been all over google and bing and must not be searching on the right phrase, because I've been able to find nothing that helps (except this forum!)

Thank you.

Joe S
jsaling
Posted: Friday, July 24, 2009 9:09:26 AM
Rank: Newbie

Joined: 7/23/2009
Posts: 2
Points: 6
Where do you live?: MA, USA
Oddly it would seem asking the question helped me better formulate a search.

I found a result that works!

In the Table Properties Sorting tab, I used the expression:

=iif(isnothing(Fields!Lock_Expire.Value),1,0)

I read this as NULL values = 1, anything else = 0. Sort starting with the 0s followed by the 1s
Scott Whigham
Posted: Sunday, July 26, 2009 5:46:29 AM


Rank: Super Mod

Joined: 3/20/2006
Posts: 466
Points: 1,020
Where do you live?: Dallas, TX
Awesome - thanks for posting the answer Smile
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.