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!

Concatenate Function 1

Status
Not open for further replies.

chw1

Technical User
May 19, 2009
1
US
I have been trying to get the Concatenate Function from Duane to work. I'm not clear on the ID fields used as an example in the comments of the code because the foreign key and the primary key share the same name. I'm assuming the reference to "FamID" is the same ID in all three places. (The foreign key in FamMem???)
example
'tblFamily with FamID as numeric primary key
'tblFamMem with FamID, FirstName, DOB,...
'return a comma separated list of FirstNames
'for a FamID
' John, Mary, Susan
'in a Query
'SELECT FamID,
'Concatenate("SELECT FirstName FROM tblFamMem
' WHERE FamID = " & [FamID]) as FirstNames
'FROM tblFamily

 
clearer so ?
'SELECT [!]tblFamily.[/!]FamID,
'Concatenate("SELECT FirstName FROM tblFamMem
' WHERE [!]tblFamMem.[/!]FamID = " & [!]tblFamily.[/!][FamID]) as FirstNames
'FROM tblFamily

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top