Click to See Complete Forum and Search --> : Access concatenate a number with Text


jkruer01
09-05-2004, 01:34 PM
Hello,

I am trying to create a SQL query against a MS Access database where I concatenate a numeric field with text and text fields.

I have concatenated multiple text fields using + and it works great. However, when I try to do this with a number field it just returns a 0.

Here is my code:
SQL = "SELECT Donor.PersonID + '|' + Donor.LastName + ', ' + Donor.FirstName + ' ' + Donor.MiddleName AS PersonID, Donor.LastName + ', ' + Donor.FirstName + ' ' + Donor.MiddleName AS Name "
SQL = SQL & "FROM Donor "


Any suggestions?

Thanks!

jkruer01
09-05-2004, 01:41 PM
Ok, nevermind I figured it out.

I replaced the + with & and it worked.

Thanks!