Missing data in some reports

C

Chigger Hill

I have a report that pulls in the name and address from my database for a
report by individual. For the names I am using a trim statement like
"=Trim([First Name]+" "+[Last Name]). This works well for most of the
reports. For some business (Not All) with only a last name, none of the name
prints. Some of the business names do print. Suggestions.
 
A

Allen Browne

Try:
=Trim([First Name] + " " & [Last Name])

This takes advantage of a slight difference between the 2 concatenation
operators in Access:
"A" + Null => Null
"A" & Null => "A"
 
J

John Spencer

Simplest is to change the + to &
=Trim([First Name] & " "& [Last Name])

Or force null values (looks like blanks) to zero-length string (different
kind of blank) using the NZ function

=Trim(Nz([First Name],"") + " " + Nz([Last Name],""))

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
C

Chigger Hill

Works perfectly. Thank you so much.
--
Chigger Hill


John Spencer said:
Simplest is to change the + to &
=Trim([First Name] & " "& [Last Name])

Or force null values (looks like blanks) to zero-length string (different
kind of blank) using the NZ function

=Trim(Nz([First Name],"") + " " + Nz([Last Name],""))

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Chigger Hill said:
I have a report that pulls in the name and address from my database for a
report by individual. For the names I am using a trim statement like
"=Trim([First Name]+" "+[Last Name]). This works well for most of the
reports. For some business (Not All) with only a last name, none of the
name
prints. Some of the business names do print. Suggestions.
 
C

Chigger Hill

Thank you very much. Very quick response.
--
Chigger Hill


Allen Browne said:
Try:
=Trim([First Name] + " " & [Last Name])

This takes advantage of a slight difference between the 2 concatenation
operators in Access:
"A" + Null => Null
"A" & Null => "A"

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Chigger Hill said:
I have a report that pulls in the name and address from my database for a
report by individual. For the names I am using a trim statement like
"=Trim([First Name]+" "+[Last Name]). This works well for most of the
reports. For some business (Not All) with only a last name, none of the
name
prints. Some of the business names do print. Suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top