Sjharrison Sjharrison - 6 months ago 32
SQL Question

Visual Studio 2010 Reporting - Replace String Expression Issue

I'm using visual studio 2010 to create a report, the data is being used from a SQL database

One particular set of data is being returned as integers instead of text, therefore I want to be able to do a statement where if the integer is 1 then set it as "Random" if 2 then set it as "Question" for example

I've tried the following but been unsuccessful

=Replace(Fields!new_IssueType.Value,"3","FM Complaint")

I'm new to creating these expressions so I apologise if this question is a simple fix.

Answer Source

Try using this code:

=IIF(Fields!new_IssueType.Value = "1","Issue",IIF(Fields!new_IssueType.Value = "2","Complaint",IIF(Fields!new_IssueType.Value="3","FM Complaint",IIF(Fields!new_IssueType.Value="4","Rejected",""))))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download