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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining multiple dates on one record 1

Status
Not open for further replies.

Layth

IS-IT--Management
Jun 7, 2005
44
US
I have two tables this is the content

Table no. 1 name: New Primary Table

AMPORDERFK, CompanyName, City
1 SCG Carson
2 MMN Hubbard
3 Staford Crystal
4 Miller Newark


Table no. 2 name: Rundatetable

AMPORDERFK, Rundate
1 11/20/03
2 06/05/04
1 01/01/01
3 09/21/04
4 07/30/80
2 06/22/81
3 08/30/93
4 04/29/84
2 07/05/00


The query I'd like is this with the dates, concatenated, separated by commas

Company, City, Dates
SCG Carson 11/20/03, 01/01/01
MMN Hubbard 06/05/04, 06/22/81, 07/05/00
Staford Crystal 09/21/04, 08/30/93
Miller Newark 07/30/80, 04/29/84


Here is my code:

Code:
SELECT [New Primary Table].AMPORDERFK, [New Primary Table].CompanyName, [New Primary Table].City, 
Concatenate("SELECT [Rundatetable].Rundate FROM [Rundatetable] WHERE [Rundatetable].AMPORDERFK =" & [AMPORDERFK] & " ORDER BY [Rundatetable].Rundate") AS DatesRun
FROM [New Primary Table];

Any help will be greatly appreciated.

Thanks,

Layth

 
I'm sorry the error message that I get is
"Undefined function 'Concatenate' in expression"

again any help is always appreciated,

thanks,

Layth
 
Thank you very much, this is exactly what I needed!

Layth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top