-1

I have the below expression

= IIF(Parameters!RepoLetterType.Value=2,"HI Fields!PaymentDueDate.Value " ,"")

In this I need to write "The Letter Dated July 23 is being Printed with the value of 3000" in the else part of IIF Statement. The date and value will come from dataset field.

I am trying to build this but am getting error. Please help

Dale K
  • 25,246
  • 15
  • 42
  • 71
  • What's the error? – Dale K Jun 30 '23 at 07:32
  • You appear to be trying to access a field inside quotes which doesn't work. – Dale K Jun 30 '23 at 07:33
  • 1
    SSRS 2005? Really? That ran out of support completely about **8 years ago**. It well past time you upgraded. – Thom A Jun 30 '23 at 07:40
  • Like @DaleK suggests, SSRS Expressions does't support expression/variable replacement. `"HI Fields!PaymentDueDate.Value"* Means return the literal string *HI Fields!PaymentDueDate.Value*. You need to concatenate the expressions together. – Thom A Jun 30 '23 at 08:42
  • Yes Dale & Thom , you both are correct .i am trying to make it within Quites and IIF Statement . Please tell any other way . how can i implement it – Rakesh Dhar Jun 30 '23 at 08:48
  • On the basis of Reportlettertype ..I need to show up Long String .... " The Printed letter Date has been withdrawn.The Amount 3000 is still pending in that letter .Please Pay . i need to Implement this .... date and value are coming from fields. how can i do this .? – Rakesh Dhar Jun 30 '23 at 08:53
  • guess it's something like " The Printed letter" & Fields!SomeDateField.Value & " blablabal" & Fields!anotherField.Value but i'm just guessing – siggemannen Jun 30 '23 at 12:31

1 Answers1

0

To combine text and fields, the static text is within double quotes and combined with fields with an &.

= IIF(Parameters!RepoLetterType.Value=2 
    ,"HI " & FORMAT(Fields!PaymentDueDate.Value, "MMMM d") 
    ,"The Letter Dated " & FORMAT(Fields!PaymentDueDate.Value, "MMMM d") & " is being Printed with the value of " & FORMATNUMBER(Fields!PaymentAMT.Value, 0)
    )
Hannover Fist
  • 10,393
  • 1
  • 18
  • 39