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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate two fields w/ space in currentdb.openrecordset

Status
Not open for further replies.

Melagan

MIS
Nov 24, 2004
443
US
Hello,

To expand on the subject line, I am trying to open a recordset which will have two fields concatenated together with a space between them. I understand why the code is getting a syntax error but I'm not sure the proper syntax on how to get a " " space. Here is what I'm trying so far:
Code:
SQLText = "SELECT FirstName & " " & LastName AS Full FROM tblAgents"

Obviously this syntax doesn't work, but again, I'm not sure on what the correct syntax would be.

For a record whose FirstName = "John" and whose LastName = "Doe", I want to see "John Doe"

Thanks in advance!


~Melagan
______
"It's never too late to become what you might have been.
 
Code:
SQLText = "SELECT FirstName & [COLOR=red]' '[/color] & LastName AS Full FROM tblAgents"

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
And if you insist on double quotes ...
Code:
SQLText = "SELECT FirstName & "" "" & LastName AS Full FROM tblAgents"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
SELECT FirstName & "" "" & LastName AS Full FROM tblAgents

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top