Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

+ operator or .. 2

Status
Not open for further replies.

nirajj

Programmer
Mar 12, 2003
103
US
SELECT table.Fname + " " + table.MI + ". " + table.LName AS Name FROM table;

I have this above query, which doesn’t seem to work properly.
Name returns blank value if MI or Lname has no value in it.
However it does show all the records, just blank values.
I am not sure if + operator is what I should be using.
All help really appreciated :)
 
Use

SELECT table.Fname & " " & table.MI & ". " & table.LName AS Name FROM table;

It is assumed table.Fname, table.MI and table.LName are all of text data type.

Regards,
 
He he - Null propagation ;-)

Null + "SomeValue" = Null
Null & "SomeValue" = "SomeValue

- which is why the ampersand is most often used in concatenation;-)

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top