Solved

Concatenating fields in SQL statement

Posted on 2007-11-16
2
446 Views
Last Modified: 2013-11-26
I have the following statement in Visual Studio 2005 which is connected to SQL Server 2005.  It complies without erros but displays the field FullName as Null.  There is data.  If I display the fields individually they show.  What am I missing?
Thanks
SELECT     LastName + ', ' + FirstName + ' ' + MiddleName + ' ' + FileNo AS FullName
FROM         dbo.tblClientInfo
0
Comment
Question by:BobRosas
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 125 total points
Comment Utility
SELECT     ISNULLILastName+ ', ' ,'')+ ISNULL(FirstName + ' ','') + ISNULL(MiddleName + ' ','') + FileNo AS FullName
FROM         dbo.tblClientInfo
0
 

Author Comment

by:BobRosas
Comment Utility
That was it!!
Thank you so much!
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now