DynDeveloper.com

DynDeveloper.com

Sign Up Now! Log In
joealt 6/27/2012 2:56:30 PM

Comma Separated Detail from a sub table

* This article, and all our great SQL (General) documentation, Is available on the SQL (General) menu

This concept applies to any Header Detail table relationship, for this example we'll talk about the SOP header/detail/serial lot relationship. We want back one line for each item in the order; and we want the serial/lots concatenated into one field. The final result will look like this:

The entire query that we need is below. Run the second script first, it's the function that makes the whole thing work.

 This code is based on the TWO database

Version: GP 2010
Section: SQL Scripts