Where to place SELECT arguments in QRP

I have a query where the SELECT has an additional content prior the FROM:

SELECT p.ItemLookupCode, p.Cost, COALESCE(SUM(c.Cost),0) FROM item p LEFT JOIN item c ON c.ParentItem = p.ID

I have placed all contents after the FROM in the QRP respective location.

Where do I place the "COALESCE(SUM(c.Cost),0)" ?

Reply to
RicoTowers
Loading thread data ...

Hi Rico,

In QRP files, You "create" teh SELECT part by creating the columns. If some of the columns You want to present, has a tSQL formula or function, You need to put that tSQL text into "FORMULA" section of the column. If You put that text into the formula section, then the FIELDNAME section You need to put the "name" of the result of the formula (AS part in tSQL).

As I've seen, You want to do a sum of a value. In this case, You need to put the GROUPMETHOD section like this "GroupMethod = groupmethodSum".

Hope this helps...

Kind regards, Antonijo

Reply to
Antonijo Todoro

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.