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 8260949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:14:09+00:00 2026-06-08T03:14:09+00:00

I am having a really strange error when using the iif() statement in SSRS

  • 0

I am having a really strange error when using the iif() statement in SSRS 2012.

I am trying to choose to print the name of a month whenever a month value is not equal to 99, and when it is equal to 99, I would like to print the string “Y.T.D” I was trying to achieve this using the statement:

=iif(Fields!Month.Value = 99, “Y.T.D”, MonthName(Fields!Month.Value, true) )

Whenever I try to use this MonthName() function the months are printed correctly but the 99 field returns as “#error”. This statement works fine when I leave the month as an integer or if I simply put in a dummy string, and I have already tried casting the MonthName() as a string (eg. “cStr(MonthName())”).

Any ideas???

  • 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-06-08T03:14:10+00:00Added an answer on June 8, 2026 at 3:14 am

    To answer my own question/to quote another answer I recieved from Syed Qazafi Anjum on Microsoft’s forum:

    =iif(Fields!Month.Value=99,"Y.T.D",monthname(iif(Fields!Month.Value<=12,Fields!Month.Value,12),true))

    As taken from:
    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/d484d8d4-3809-4850-ada6-8cac1239bfce/

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

Sidebar

Related Questions

I am having a really strange problem implementing Java REST service. I am trying
I am having a strange problem when using this XML-to-NSDictionary class.really it was working
I'm having a really strange problem. I'm trying to download some file and store.
I'm having a really strange issue with .htaccess - I'm trying to rewrite the
I'm having a really strange problem. I have 2 virtual machines running ubuntu 11.4
I'm having a really strange problem and I'm looking for any possible ideas. I
Having a really aggravating problem using Managed Metadata in SP2010 where I can get
I am really having trouble trying to figure out how to find certain records
I'm having a really difficult time trying to get php to connect to SQL
I'm having a really strange issue with named helpers. So let's start off with

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.