Jumat, 20 Mei 2011

RE: [MS_AccessPros] How do I add to this SQL code to get expected results?

 


It seems like I have answered similar questions a couple times in the last couple days. There is no "tweak" that concatenates like this. You can use the generic concatenate function found at http://www.rogersaccesslibrary.com/forum/generic-function-to-concatenate-child-records_topic16.html.

There is a sample database that shows how to use the function.

Duane Hookom
MS Access MVP


From: digibiz2@yahoo.com

Sql query looks like this:

SELECT Table1.Reference AS Reference, First(Table1.Loading) &
IIf(Count(Table1.Loading)>1,"," & Last(Table1.Loading)) AS Loading
FROM Table1
GROUP BY Table1.Reference;

It's only returning 2 loading systems, because of first and last. How do I get
it to return more than 3 or more? How do I tweak this to make it happen?

Original table
REFERENCE LOADING
12345 NDB
12345 PULSE
12345 NICE
12345 DIAMOND

On one line right now it returns:
12345 NDB, PULSE

I want it to return this, on the same line:
12345 NDB, NICE, PULSE, DIAMOND

How do I tweak the query to make it happen??



[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar