School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,406 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,661 people online right now. Registration is fast and FREE... Join Now!




SSRS parameters

 

SSRS parameters

reCoded

30 Jun, 2009 - 07:01 AM
Post #1

D.I.C Regular
***

Joined: 25 Feb, 2008
Posts: 270



Thanked: 5 times
My Contributions
I have a report and in my SQL query I have the following:

CODE

SELECT 'All' AS number FROM dual
UNION
SELECT  DISTINCT number
FROM default_orders
ORDER BY number


Now in my SSRS report I preview my report and it runs my report fine. Only thing is that my drop down parameter list looks like this.

01
03
293
300
All
R#
RFE

My problem here is that I would like to have "All" be at the top of the list. I looked through everything and I am not sure if there is an option so when the report loads it will default to "All" instead of "01". I hope someone can help me out.

Thanks.


User is offlineProfile CardPM
+Quote Post


corliss

RE: SSRS Parameters

24 Jul, 2009 - 08:11 AM
Post #2

D.I.C Head
Group Icon

Joined: 25 Oct, 2006
Posts: 169



Thanked: 1 times
Dream Kudos: 50
My Contributions
QUOTE(reCoded @ 30 Jun, 2009 - 07:01 AM) *

I have a report and in my SQL query I have the following:

CODE

SELECT 'All' AS number FROM dual
UNION
SELECT  DISTINCT number
FROM default_orders
ORDER BY number


Now in my SSRS report I preview my report and it runs my report fine. Only thing is that my drop down parameter list looks like this.

01
03
293
300
All
R#
RFE

My problem here is that I would like to have "All" be at the top of the list. I looked through everything and I am not sure if there is an option so when the report loads it will default to "All" instead of "01". I hope someone can help me out.

Thanks.


Hi recoded,
You must change your order statement to be something like checking to see if the value in the col number is a number:
CODE

select your_column from your_table
Union
select distinct your_column from your_table
order by
case when isnumeric(your_column) <> 1 then your_column else 999999999 end,
your_column


What this pusedo code will do is sort the varchars and put them at the top.
I hope this helps.
User is offlineProfile CardPM
+Quote Post

ForcedSterilizationsForAll

RE: SSRS Parameters

24 Jul, 2009 - 08:19 AM
Post #3

D.I.C Head
**

Joined: 16 Jul, 2009
Posts: 209



Thanked: 5 times
My Contributions
CODE

SELECT -1 AS tSortOrder, 'All' AS lNumber
UNION
SELECT DISTINCT number AS tSortOrder, Number AS lNumber
FROM default_orders
ORDER BY tSortOrder

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 10:54PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month