Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6874835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:14:41+00:00 2026-05-27T04:14:41+00:00

I am developing an SSRS 2008 report and am trying to get one of

  • 0

I am developing an SSRS 2008 report and am trying to get one of my stored procs to output “-All-” unioned with the other possible values for this parameter, where “-All-” appears as the first value. Instead, “-All-” is sorted in alphabetical order so that “Adams” is listed first. How do I make “-All-” come first? (Note that this parameter is a uniqueidentifier, so I cannot make “-All-” = -1. Here is my T-SQL code right now:

Select NULL As [client_id], NULL AS [id_no], '-All-' As [full_name], '-All-' As [id_and_name]
UNION ALL
Select Distinct [people_id] AS [client_id], [id_no], [full_name], [full_name] + ' : ' + [id_no] AS [id_and_name]
From [evolv_cs].[dbo].[service_track_current_view] With (NoLock) 
Order By [full_name]

When I tried this code:

Select NULL As [client_id], NULL AS [id_no], '-All-' As [full_name], '-All-' As [id_and_name]
UNION ALL
Select Distinct [people_id] AS [client_id], [id_no], [full_name], [full_name] + ' : ' + [id_no] AS [id_and_name]
From [evolv_cs].[dbo].[service_track_current_view] With (NoLock) 
Order By 
CASE [full_name] WHEN '-All-' THEN 0 ELSE 1 END,

[full_name]

I got this error:

Msg 207, Level 16, State 1, Line 6
Invalid column name 'full_name'.
Msg 104, Level 16, State 1, Line 6
ORDER BY items must appear in the select list if the statement contains a UNION, INTERSECT or EXCEPT operator.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:14:41+00:00Added an answer on May 27, 2026 at 4:14 am

    If it’s possible for you to add a column, then you could add 0 AS [sort_value] to the first part of the union and 1 AS [sort_value] to the second part of the union.

    Then simply Order By [sort_value],[full_name]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an SSRS 2008 report. I created one dataset to give me
I am developing a stored proc for an SSRS 2008 report, but I want
I am developing an SSRS 2008 report which contains a number of simple charts.
I have a report I am developing in BIDS for SSRS 2008 R2 that
I am developing an RDL in SSRS 2008 and am trying to move a
I am developing an SSRS 2008 report. I created a tablix, however, when I
Developing a website and just trying to get back into the swing of (clever)
I've been developing an SSRS 2005 report (a form letter) that contains two tables.
I'm using a barcode font (IDAutomationMC39H) in an SSRS 2005 report I'm developing, and
I can't believe this - I just starting developing an SSRS report, using a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.