M marks2007 Registered User. Local time Today, 11:36 Joined Nov 12, 2007 Messages 31 Dec 14, 2007 #1 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
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
pbaldy Wino Moderator Staff member Local time Today, 11:36 Joined Aug 30, 2003 Messages 36,270 Dec 14, 2007 #2 Try + instead of &.
boblarson Smeghead Local time Today, 11:36 Joined Jan 12, 2001 Messages 32,059 Dec 14, 2007 #3 marks2007 said: 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 Click to expand... 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.
marks2007 said: 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 Click to expand... 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.