View Single Post
  #11  
Old June 4th, 2010, 07:02 PM posted to microsoft.public.access.reports
David W. Fenton
external usenet poster
 
Posts: 3,373
Default Firstname plus Middlename??

John Spencer wrote in
:

You have made an error in your expression.

" " & MiddleName will always return at least a space.
The plus sign will see the space and return it.

If you wanted to be safe you could use
[surname] & ", " & [firstname] & (" " + [middlename])

Although you could still end up with extra spaces if firstName and
middlename are null you would end up with
Spencer, and a space. "Spencer, "


This solves all the possibilities:

Mid(("12"+[LastName]) & (", "+(Trim([FirstName]
& (" "+[MiddleName])))),3)

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/