• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Looping over multiple rows of data to output one row

Explorer ,
May 22, 2006 May 22, 2006

Copy link to clipboard

Copied

My query is giving me the appropriate data, but I need to only have one row per 'MANAGER' in my output - not one for each 'JOB'. Now the output looks like this:

manager 1 ... period 1 $ .... period 2 $ .... period 3 $
manager 1... period 1 $ .... period 2 $ .... period 3 $
manager 1... period 1 $ .... period 2 $ .... period 3 $
manager 1... period 1 $ .... period 2 $ .... period 3 $

manager 2... period 1 $ .... period 2 $ .... period 3 $
manager 2... period 1 $ .... period 2 $ .... period 3 $
manager 2... period 1 $ .... period 2 $ .... period 3 $
manager 2... period 1 $ .... period 2 $ .... period 3 $

It needs to be:

Manager 1 ... total period 1 $ .... total period 2 $ ....
Manager 2 ... total period 1 $ .... total period 2 $ ....

Any help would be wonderful. I am really new at something this complex. Thanks!!!

TOPICS
Advanced techniques

Views

219

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 22, 2006 May 22, 2006

Copy link to clipboard

Copied

duplicate post

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
May 22, 2006 May 22, 2006

Copy link to clipboard

Copied

LATEST
To fix your immediate issue, you need to order and group by manager, not MPR_ID (whatever that is).
What is dm_id? Use descriptive names!

Anyway, change the ORDER BY clause to:
ORDER BY
RR.LastName+', '+RR.FirstName, <!--- Or maybe dm_id?? --->
AA.MPR_ID


Then change the first <cfoutput> to:
<cfoutput query="production" group="Rep_name">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation