Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fullname in reports

Status
Not open for further replies.

topwaya

Technical User
May 4, 2005
150
US
I made a query (with help from your query forum - thanks!) to get the "FullName" for people in my tblPersonal table.

The query SQL is
Code:
SELECT tblPersonal.NameL & ", " & 
       tblPersonal.NameF & 
       IIF ( Len(NZ(tblPersonal.NICK,"")) > 0, 
       " """ & tblPersonal.NICK & """ ", "") & " " &
        tblPersonal.SUFFIX AS FullName
FROM tblPersonal
ORDER BY tblPersonal.NameL, tblPersonal.NameF, tblPersonal.SUFFIX;

It produces results like:

Doe, John "Johnny" JR

I would like to use this in a report that lists all the members. But when I try to do this I get an error that I can't use a query that is based on a table that I'm already using in the report. What's the best way to solve this?

Thanks Much!!
 
I figured it out.

I needed to add the primary key (PID) to the fullname query and then add that fullname query as a table to my other query, then use that other query for the report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top