What does & ", " & means ?

  • Thread starter Thread starter SpookiePower
  • Start date Start date
S

SpookiePower

I found this query in the Northwind sample database.

SELECT Employees.EmployeeID, [LastName] & ", " & [FirstName] AS ReportsTo
FROM Employees
ORDER BY Employees.LastName, Employees.FirstName;

I do not know, in the first line, what & ", " & means ??

Someone who can help me with this one ?
 
[LastName] & ", " & [FirstName]

this takes two fields [LastName] and [FirstName] and combines them
into one field with a comma seperating them.

So:
[FirstName] = "Jason"
[LastName] = "Lepack"
[LastName] & ", " & [FirstName] = "Lepack, Jason"

Cheers,
Jason Lepack
 
I do not know, in the first line, what & ", " & means ??

Any string surrounded by quotemarks is just a literal text string - in this
case, a comma followed by a blank. If you had "Spookie" it would be the
literal text string Spookie.

The & operator concatenates two strings, just like the + operator adds two
numbers.

So if FirstName is John, and LastName is Vinson, the expression would
concatenate three pieces of text - the last name, a literal text string, and
the firstname - to give

Vinson, John

as the result.

John W. Vinson [MVP]
 
Back
Top