INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Conditional Format of the Format Property Problem

Conditional Format of the Format Property Problem

(OP)
I am new to conditional formatting the format property and maybe I can't do what I am trying to do.

I have a stored procedure that contains a type field and monthly values which are formatted as money. In SSRS, I need the format property to look at the type and decide which type of formatting the number needs.

For example:

if type = % Difference, I want to format as percent with no decimal places
if type is anything other than % Difference, I want to format positive numbers like #,##0 and negative numbers like (#,##0)

I have tried many combinations in the format property expression, but this is the only one that gets me close.

=iif(Fields!Type.Value = "% Difference", Format(Fields!M2.Value, "P0"),
iif(Fields!Type.Value <> "% Difference" and Fields!M2.Value < 0, Format(Fields!M2.Value, "(#,##0)"),
iif(Fields!Type.Value <> "% Difference" and Fields!M2.Value >= 0, Format(Fields!M2.Value, "#,##0"),"")))

This formula does something strange with my numbers though. For example, one number should read 24,852,000. However, what actually shows up is 24,852,24,852,000

Any help would be greatly appreciated.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close