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

  • Home
  • SEARCH
  • 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 347635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:17:21+00:00 2026-05-12T11:17:21+00:00

The Situation (Ignore this it is boring): I have reports that I created using

  • 0

The Situation (Ignore this it is boring):
I have reports that I created using reporting services. Some of these reports take the parameter, “Month”. They enter in an integer for the month they want. Example: December = 12.
In order to view the report, I am simply using the Report Viewer in visual studio. I need the month field to be a drop down box in order to select the month by name. There is a feature in in reporting services that allows you to bind the field to a stored procedure in order to create value/text pairs for the drop down list.

The Problem:
I don’t want to create a “months” table in my database but I need to have a stored procedure that can return all the month/int pairs. I’m sure there is a very easy solution to this but I’m not sure what it is! My first thought was creating a temp table, but I am not sure how to add manually add each month/int pair to the table… All your suggestions are appreciated!

What I want is the following statement, except without the use of the Months Table:

SELECT MonthID, MonthName
FROM Months
  • 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-12T11:17:21+00:00Added an answer on May 12, 2026 at 11:17 am

    How about:

    CREATE PROCEDURE ListMonths
    AS
    
        SELECT 1 AS MonthId, 'January' AS MonthName
         union all select 2, 'February'
         union all select 3, 'March'
         union all select 4, 'April'
         union all select 5, 'May'
         union all select 6, 'June'
         union all select 7, 'July'
         union all select 8, 'August'
         union all select 9, 'September'
         union all select 10, 'October'
         union all select 11, 'November'
         union all select 12, 'December'
    
    GO
    

    Call this and I believe it returns what you want.

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

Sidebar

Related Questions

The situation is this: You have a Hibernate context with an object graph that
Situation: I have a simple XML document that contains image information. I need to
Situation: text: a string R: a regex that matches part of the string. This
The situation: I have a pieceofcrapuous laptop. One of the things that make it
Say, we have some items, and each defines some partial sorting rules, like this:
How can one ignore Unexpected element situation in JAXB ans still get all other
In my current situation, it is not unusual for me to have several UNIX
The situation is this: My system (Win XP Pro) is unable to copy a
In an application I have a lot of classes that are apparently not descendants
Ok, this is a little weird. Ignore what I am trying to do, and

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.