how combine two fileds?

marks2007

Registered User.
Local time
Today, 11:36
Joined
Nov 12, 2007
Messages
31
Hi,

I am using SQL Server 2005

I try this

select firstname & lastname, id from list

I get error,it seems '&' is wrong.

Please let me know how to combine the two fields

Thanks

Mark
 
Try + instead of &.
 
Hi,

I am using SQL Server 2005

I try this

select firstname & lastname, id from list

I get error,it seems '&' is wrong.

Please let me know how to combine the two fields

Thanks

Mark


If you are going to use the concatenation you need to alias it:

select firstname & ' ' & lastname As UserName, id from list

And I would put a space in between unless you need Bob Larson to show as BobLarson.
 

Users who are viewing this thread

Back
Top Bottom