Hi,
I did try that, but the statement
AND item_group_status_id=1
is missing and this needs only to be used for the Pending, not for the Analysis
The results for In_Analysis is
Created_Dt In_Analysis
1/17/2004 4
1/19/2004 0
1/20/2004 0
1/21/2004 3
1/26/2004 0
The results for Pending is
Created_Dt Pending
1/20/2004 3
1/21/2004 5
1/26/2004 1
If I use the query that you provided then the 1st row from the Pending results won't be listed. This is what we had before and when I inserted the "AND item_group_status_id=1" for the Pending, it still didn't work

:
(SELECT TRUNC (created_dt) created_dt,
SUM (DECODE (item_group_status_id, 1, 1, 0)) "PENDING"
FROM ITEM_GROUPS
WHERE item_group_category_id = 3
GROUP BY TRUNC (created_dt)) Pending,
(SELECT TRUNC (cust.Transaction_DT) transaction_dt,
SUM (DECODE (item_group_status_id, 4, 1, 0)) "IN_STORAGE",
SUM (DECODE (item_group_status_id, 5, 1, 0)) "IN_TRANSIT",
SUM (DECODE (item_group_status_id, 6, 1, 0)) "IN_ANALYSIS"
FROM ITEM_GROUPS,
(SELECT *
FROM CUSTODIES
WHERE closed_dt IS NULL) cust
WHERE cust.item_group_id = ITEM_GROUPS.item_group_id
AND ITEM_GROUPS.item_group_category_id = 3 -- Evidence
GROUP BY TRUNC (cust.Transaction_DT)) Other
WHERE pending.created_dt = other.transaction_dt;