Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Concatenating fields in SQL statement

Posted on 2007-11-16
2
449 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
ID: 20299860
SELECT     ISNULLILastName+ ', ' ,'')+ ISNULL(FirstName + ' ','') + ISNULL(MiddleName + ' ','') + FileNo AS FullName
FROM         dbo.tblClientInfo
0
 

Author Comment

by:BobRosas
ID: 20299883
That was it!!
Thank you so much!
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

856 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