Jumat, 20 Mei 2011

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

 

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??

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar