How do I concatenate fields in MSAccess SQL?

  • Thread starter Thread starter Siegfried Heintze
  • Start date Start date
S

Siegfried Heintze

Can anyone tell me how to make this attached SQL statement work? I'm trying
to concatenate two fields from two different tables using a plus (+) and it
does not work! I also tried CONCAT(CaseTypes.sDescription,
BaseCaseTypes.sDescripton ) but that does not work either!

Thanks,
Siegfried

SELECT CaseTypes.id AS id, CaseTypes.sDescription +
BaseCaseTypes.sDescripton AS sDesc, bDefault FROM CaseTypes, BaseCaseTypes
WHERE bPrivate = 0 AND CaseTypes.ridBaseType = BaseCaseTypes.id ORDER BY
CaseTypes.sDescription
 
"+" will work some times. The preferred method is using "&" like:
FullName: FirstName & " " & LastName
 
Dear Siegfried:

I'm not sure why + is not concatenating for you assuming the values
are text. Ampersand (&) works, or is supposed to work, almost the
same, except for how it treats NULLs. Try that, please.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Hi,

In MS SQL Server? are you be sure both are strings?

SELECT STR(CaseTypes.sDescription) + STR(BaseCaseTypes.sDescripton) As
sDesc, ...


If you use Jet, try & instead of + .



Hoping it may help,
Vanderghast, Access MVP
 
Thank you. "&" is working. I'm really feeling fustrated that I cannot find
this documented in msdn.microsoft.library.
Can someone point me to a URL where this (and presumably other functions and
operators) are documented?

Thanks,
Siegfried
 
Back
Top