Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Don't burn bridges. You'll be surprised how many times you have to cross the same river
 
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!!!!

13
January

How Do I Deal with Null Values in Address Formula Fields in SQL?

During a recent training session on of the delegates asked "How do I stop Null addresses, if one of the address fields is Null in the formula"?



Solution:

There are a number of ways to achieve this but I tend to use the SQL COALESCE function.

The Coalesce function checks to see if the field is null, and if it is will use the user defined alternative.

SELECT Tablename.Address_1 + COALESCE (', ' + Tablename.Address_2, '') As Full_Address FROM Tablename


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 *