Immediate If Or CASE Statement to Concatenate values

Posted on 2008-11-04
Medium Priority
Last Modified: 2012-08-14
I have a table on a report in SSRS and I need to format a field in a cell;

I have Eventnames and Rooms;
In my sql query on the back end (ms sql server), I select both fields as such:
ISNULL((R.[meeting room]),'') AS meetingroom,
E.[EventName] AS eventname,
But, Im thinking I should do the logic on the report gui instead;

If the eventname is NULL, ignore it;
And If the field is not null, concatenate the eventname at the end of the meetingroom, preferably in parentheses-
Valid values for my meetingroom are:
Mtg Rm 1
Mtg Rm 2

Valid values for EventName in my database field are:  --
Plaza Summer Crafts
Farmers Market

So, an example of a valid value for the table would be: Mtg Rm 1 (Plaza Summer Crafts)
Thanks In Advance.
Question by:jtrapat1
  • 2
LVL 12

Accepted Solution

jgv earned 500 total points
ID: 22881559
It's actually easier in the sql statement.

ISNULL((R.[meeting room]),'') AS meetingroom,
E.[EventName] AS eventname,
ISNULL((R.[meeting room]),'')  + ISNULL(' (' + E.[EventName] + ')', '') AS fulldescription

Author Comment

ID: 22886771
If you are still around, I have another related question-
I will open up a new post if I dont hear from you;
But, Is there any way, that I could force a line break on the cell in this table?
I would like to have this cell height increase, if need be, and if the other two columns increase, that is OK.

LVL 12

Expert Comment

ID: 22886986
You have to specify a line break in the expression:
="First Line" & vbCrLf & "Second Line"

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question