Groups | Blog | Home
all groups > sql server reporting services > july 2006 >

sql server reporting services : Return Different Fields Based On Expression


JDArsenault
7/6/2006 2:10:03 PM
Hello Out There,

I have a dataset set up to return a set of billing information. I have this
information displayed in a matrix. However I have requirement where;

a) If the account type = ODC then return the vendor_name field
b) If the account type = ODC and venor_name field is null then return the
employee_name field
c) In any other case return the employee_name field.

Is there a way to set up an expression in a text box on the detail line of a
matrix to reflect the info needed?

There's a little more to be desired with my expression syntax skills so any
help would be greatly appreciated.

Tim Dot NoSpam
7/8/2006 12:24:53 AM
You should do this in the SQL and return it in a single column.

In SQL Server,

NameField = CASE
WHEN accountType = ODC
CASE
WHEN vendor_name is null then employee_name
ELSE vendor_name
END
else
EMPLOYEE_NAME
END

-tIM
[quoted text, click to view]

JDArsenault
7/10/2006 8:08:02 AM
I often don't see the forest through the trees. Thanks for the quick help.

JD

[quoted text, click to view]
AddThis Social Bookmark Button