By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,045 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,045 IT Pros & Developers. It's quick & easy.

sql concatenate

P: n/a
Hi,

I would like a sql query that would return the results of 3 selections as
one column. For example I may have

select title, forename, surname from details;

but would like the results in one column, with the fields concatenated (with
a space preferable between!)

This should be simple, right? :)

Thanks,
Chris
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The SQL behind the query should read
SELECT [Title] & " " & [ForeName] & " " & [Surname] AS WholeName
FROM Details;

To do it in the design grid:
Type the new field name followed by a colon then type the first name of the
field followed by the &, then 2 double quotes with a space between them,
followed by the second field name etc.

Stewart
"C L Humphreys" <cl*********@toofgib.moc> wrote in message
news:bk**********@ucsnew1.ncl.ac.uk...
Hi,

I would like a sql query that would return the results of 3 selections as
one column. For example I may have

select title, forename, surname from details;

but would like the results in one column, with the fields concatenated (with a space preferable between!)

This should be simple, right? :)

Thanks,
Chris

Nov 12 '05 #2

P: n/a
Alternate: SELECT Title + ' ' & Forename & ' ' & Surname) AS FullName FROM
details;

Works great for middle names!

Tim Mills-Groninger

"Allen Browne" <ab***************@bigpond.net.au> wrote in message
news:Xs********************@news-server.bigpond.net.au...
SELECT Trim(Title & ' ' & Forename & ' ' & Surname) AS FullName FROM
details;

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"C L Humphreys" <cl*********@toofgib.moc> wrote in message
news:bk**********@ucsnew1.ncl.ac.uk...
Hi,

I would like a sql query that would return the results of 3 selections as one column. For example I may have

select title, forename, surname from details;

but would like the results in one column, with the fields concatenated

(with
a space preferable between!)


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.