Combine Firstname and Last Name (1 Viewer)

Bigmo2u

Registered User.
Local time
Today, 00:01
Joined
Nov 29, 2005
Messages
200
I know this is easy and I have done it before, but just can't seem to wrap my head around it again. Writing the query in VBA.

Code:
SELECT (tblOwner.oFirst" & " tblOwner.oLast) AS FullName
FROM tblOwner

Error code is:

Syntax error (missing Operator) in query expression '(tblOwner.ofirst tablOwner.oLast)'.
 

pr2-eugin

Super Moderator
Local time
Today, 06:01
Joined
Nov 30, 2011
Messages
8,494
This is what you need,
Code:
SELECT (tblOwner.oFirst & " " & tblOwner.oLast) AS FullName
FROM tblOwner
 

bob fitz

AWF VIP
Local time
Today, 06:01
Joined
May 23, 2011
Messages
4,726
Try:
Code:
SELECT tblOwner.oFirst" & " tblOwner.oLast AS FullName
FROM tblOwner
 

Bigmo2u

Registered User.
Local time
Today, 00:01
Joined
Nov 29, 2005
Messages
200
Here is the full code eventhoough this is what is throwing the error:

Code:
"SELECT tblProjects.ProjectID, tblProjects.ProjectName, tblProjects.ProjectDescription, " & _
         "(tblOwner.oFirst & " " & tblOwner.oLast) AS FullName, tblProjectType.ProjectTypeDesc, " & _
         "tblPriority.PriorityDesc, tblStatus.StatusDesc, tblTier.TierDesc, tblProjects.PercentComplete, " & _
         "tblProjectType.ProjectTypeDesc, tblProjects.StartDate, tblProjects.EndDate, tblProjects.ChangedDate, " & _
         "tblProjects.Attachments, tblProjects.CurrentStatusComments, tblProjects.TotalTasks, tblProjects.OpenTasks, " & _
         "tblProjects.Active, tblProjects.ActualResourceHours " & _
         "FROM tblTier RIGHT JOIN (tblStatus RIGHT JOIN (tblProjectType RIGHT JOIN (tblPriority RIGHT JOIN " & _
         "(tblOwner RIGHT JOIN tblProjects ON tblOwner.OwnerID = tblProjects.OwnerID) ON tblPriority.PriorityID = " & _
         "tblProjects.PriorityID) ON tblProjectType.ProjectTypeID = tblProjects.ProjectTypeID) ON tblStatus.StatusID " & _
         "= tblProjects.StatusID) ON tblTier.TierID = tblProjects.TierID"

And

Code:
lstSQL = "SELECT tblProjects.ProjectID, tblProjects.ProjectName, tblProjects.ProjectDescription, " & _
         "(tblOwner.oFirst" & " tblOwner.oLast) AS FullName, tblProjectType.ProjectTypeDesc, " & _
         "tblPriority.PriorityDesc, tblStatus.StatusDesc, tblTier.TierDesc, tblProjects.PercentComplete, " & _
         "tblProjectType.ProjectTypeDesc, tblProjects.StartDate, tblProjects.EndDate, tblProjects.ChangedDate, " & _
         "tblProjects.Attachments, tblProjects.CurrentStatusComments, tblProjects.TotalTasks, tblProjects.OpenTasks, " & _
         "tblProjects.Active, tblProjects.ActualResourceHours " & _
         "FROM tblTier RIGHT JOIN (tblStatus RIGHT JOIN (tblProjectType RIGHT JOIN (tblPriority RIGHT JOIN " & _
         "(tblOwner RIGHT JOIN tblProjects ON tblOwner.OwnerID = tblProjects.OwnerID) ON tblPriority.PriorityID = " & _
         "tblProjects.PriorityID) ON tblProjectType.ProjectTypeID = tblProjects.ProjectTypeID) ON tblStatus.StatusID " & _
         "= tblProjects.StatusID) ON tblTier.TierID = tblProjects.TierID"
 

bob fitz

AWF VIP
Local time
Today, 06:01
Joined
May 23, 2011
Messages
4,726
Sorry. Try:
Code:
SELECT tblOwner.oFirst & " " & tblOwner.oLast AS FullName
FROM tblOwner
 

pr2-eugin

Super Moderator
Local time
Today, 06:01
Joined
Nov 30, 2011
Messages
8,494
You should have mentioned you were working with VBA :rolleyes:
Code:
         "SELECT tblProjects.ProjectID, tblProjects.ProjectName, tblProjects.ProjectDescription, " & _
         "(tblOwner.oFirst & ' ' & tblOwner.oLast) AS FullName, tblProjectType.ProjectTypeDesc, " & _
         "tblPriority.PriorityDesc, tblStatus.StatusDesc, tblTier.TierDesc, tblProjects.PercentComplete, " & _
         "tblProjectType.ProjectTypeDesc, tblProjects.StartDate, tblProjects.EndDate, tblProjects.ChangedDate, " & _
         "tblProjects.Attachments, tblProjects.CurrentStatusComments, tblProjects.TotalTasks, tblProjects.OpenTasks, " & _
         "tblProjects.Active, tblProjects.ActualResourceHours " & _
         "FROM tblTier RIGHT JOIN (tblStatus RIGHT JOIN (tblProjectType RIGHT JOIN (tblPriority RIGHT JOIN " & _
         "(tblOwner RIGHT JOIN tblProjects ON tblOwner.OwnerID = tblProjects.OwnerID) ON tblPriority.PriorityID = " & _
         "tblProjects.PriorityID) ON tblProjectType.ProjectTypeID = tblProjects.ProjectTypeID) ON tblStatus.StatusID " & _
         "= tblProjects.StatusID) ON tblTier.TierID = tblProjects.TierID"
 

Bigmo2u

Registered User.
Local time
Today, 00:01
Joined
Nov 29, 2005
Messages
200
I know this is easy and I have done it before, but just can't seem to wrap my head around it again. Writing the query in VBA.

Code:
SELECT (tblOwner.oFirst" & " tblOwner.oLast) AS FullName
FROM tblOwner

Error code is:

Syntax error (missing Operator) in query expression '(tblOwner.ofirst tablOwner.oLast)'.

I did say it
 

Bigmo2u

Registered User.
Local time
Today, 00:01
Joined
Nov 29, 2005
Messages
200
pr2-eugin, I think you forgot to post the code?
 

pr2-eugin

Super Moderator
Local time
Today, 06:01
Joined
Nov 30, 2011
Messages
8,494
The site is having some problems, try Clearing the cache (CTRL+F5). I have given the code in Post#8
 

Bigmo2u

Registered User.
Local time
Today, 00:01
Joined
Nov 29, 2005
Messages
200
Its not showing it to me after several (CTRL +F5)'s :banghead: :banghead:
 

pr2-eugin

Super Moderator
Local time
Today, 06:01
Joined
Nov 30, 2011
Messages
8,494
Glad to help ! Sorry about the mess up, both from my end and the website end.
 

svuyyuru

Registered User.
Local time
Today, 01:01
Joined
Feb 10, 2014
Messages
33
To Combine

SELECT
MyTable.FirstName & " " & MyTable.LastName
FROM MyTable
 

Users who are viewing this thread

Top Bottom