I am using Crystal 8.5
I have a DB2 'view' (from 3 tables) that includes the following information:
Name Definition
Grp :Group #
ACB: Acct #
ACD :Tran date
GrpNme :Group Name
Tsk : Task #
TskDt :Task Completion Date
I want to build a report like:
Grp ACB ACD GrpNme Task44 Task51 Task59.....
12345 1 4/1/2002 xyz 4/10/2002 5/1/2002
25212 1 4/2/2002 abc 5/3/2002 5/5/2002
there are six (6) tasks for each group that I need to select and print dates (whether or not the date is there).
Currently....I get six (6) print lines for each group #.
Any suggestions as to how (or if) this can be accomplished??
Below is a copy of my current code:
SELECT
GRB, ACB, GRM_OWN, ACD, TSK, TskDt
(CASE TSK WHEN 44 THEN TskDt ELSE NULL END) AS Task44,
(CASE TSK WHEN 51 THEN TskDt ELSE NULL END) AS Task51,
(CASE TSK WHEN 59 THEN TskDt ELSE NULL END) AS Task59,
(CASE TSK WHEN 60 THEN TskDt ELSE NULL END) AS Task60,
(CASE TSK WHEN 61 THEN TskDt ELSE NULL END) AS Task61
FROM
PROD.table
WHERE
(GRB NOT IN (297020, 265250, 285871, 294403) AND ACC_TRSN_STAT = '1' (active status)
AND Tsk = 44 OR
Tsk = 51 OR
Tsk = 59 OR
Tsk = 60 OR
Tsk = 61) AND
GRB IN
(SELECT GRB
FROM PROD.table
WHERE
(Tsk = 62 AND TskDt IS NULL))
ORDER BY
"GRB" ASC,
"ACB" ASC,
"ACD_TRSN" ASC
any suggestions greatly appreciated....I'm going crazy!!!
I have a DB2 'view' (from 3 tables) that includes the following information:
Name Definition
Grp :Group #
ACB: Acct #
ACD :Tran date
GrpNme :Group Name
Tsk : Task #
TskDt :Task Completion Date
I want to build a report like:
Grp ACB ACD GrpNme Task44 Task51 Task59.....
12345 1 4/1/2002 xyz 4/10/2002 5/1/2002
25212 1 4/2/2002 abc 5/3/2002 5/5/2002
there are six (6) tasks for each group that I need to select and print dates (whether or not the date is there).
Currently....I get six (6) print lines for each group #.
Any suggestions as to how (or if) this can be accomplished??
Below is a copy of my current code:
SELECT
GRB, ACB, GRM_OWN, ACD, TSK, TskDt
(CASE TSK WHEN 44 THEN TskDt ELSE NULL END) AS Task44,
(CASE TSK WHEN 51 THEN TskDt ELSE NULL END) AS Task51,
(CASE TSK WHEN 59 THEN TskDt ELSE NULL END) AS Task59,
(CASE TSK WHEN 60 THEN TskDt ELSE NULL END) AS Task60,
(CASE TSK WHEN 61 THEN TskDt ELSE NULL END) AS Task61
FROM
PROD.table
WHERE
(GRB NOT IN (297020, 265250, 285871, 294403) AND ACC_TRSN_STAT = '1' (active status)
AND Tsk = 44 OR
Tsk = 51 OR
Tsk = 59 OR
Tsk = 60 OR
Tsk = 61) AND
GRB IN
(SELECT GRB
FROM PROD.table
WHERE
(Tsk = 62 AND TskDt IS NULL))
ORDER BY
"GRB" ASC,
"ACB" ASC,
"ACD_TRSN" ASC
any suggestions greatly appreciated....I'm going crazy!!!