Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
A belief is not merely an idea that the mind possesses, it is an idea that possesses the mind
 
R. Bolton
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

16
November

How Do I Concatenate Fields with Null Values in SQL Reporting Services?

During a recent training session a delegate asked "How do I concatenate fields that contain null values correctly?"


Solution

When creating SQL statements to concatenate fields, if one of the fields within the formula is NULL, the resulting calculated field will display a null value.

To resolve this issue, one must use the COALESCE function

The final formula will be:

COALESCE (Tablename.Fieldname_1, ' ') + ' ' + COALESCE (Tablename.Fieldname_2, ' ') + ' ' + COALESCE (Tablename.Fieldname_3, ' ')


If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us

MAKE A COMMENT

Name *

Email Address *

Comment *