The No current Record problem seems to be related to the type of JOIN, but I can not get the data I want when I use the inner join. AND, if I take out the information about the Duplicate record (see bold) I also get records.
The following returns NO CURRENT RECORD
SELECT [REF_Dashboard Base].dashboard_rpt, [REF_Dashboard Base].dashboard_rpt_order, UNIT_REVENUE.VIEW, Sum(UNIT_REVENUE.jan_is) AS JAN03_IS, Sum(UNIT_REVENUE.feb_is) AS FEB03_IS, Sum(UNIT_REVENUE.mar_is) AS MAR03_IS, Sum(UNIT_REVENUE.apr_is) AS APR03_IS, Sum(UNIT_REVENUE.may_is) AS MAY03_IS, Sum(UNIT_REVENUE.jun_is) AS JUN03_IS, Sum(UNIT_REVENUE.jul_is) AS JUL03_IS, Sum(UNIT_REVENUE.aug_is) AS AUG03_IS, Sum(UNIT_REVENUE.sep_is) AS SEP03_IS, Sum(UNIT_REVENUE.oct_is) AS OCT03_IS, Sum(UNIT_REVENUE.nov_is) AS NOV03_IS, Sum(UNIT_REVENUE.dec_is) AS DEC03_IS, Sum(+[jan_is]+[feb_is]+[mar_is]+[apr_is]+[may_is]+[jun_is]+[jul_is]+[aug_is]+[sep_is]+[oct_is]+[nov_is]+[dec_is]) AS [Total IS], Sum(UNIT_REVENUE.YTD_03_IS) AS SumOfYTD_03_IS, Sum(UNIT_REVENUE.CUR_MO_03_IS) AS SumOfCUR_MO_03_IS, UNIT_REVENUE.[Duplicate?]
FROM UNIT_REVENUE RIGHT JOIN [REF_Dashboard Base] ON (UNIT_REVENUE.[DASHBOARD SO] = [REF_Dashboard Base].dashboard_rpt_order) AND (UNIT_REVENUE.DASHBOARD = [REF_Dashboard Base].dashboard_rpt)
GROUP BY [REF_Dashboard Base].dashboard_rpt, [REF_Dashboard Base].dashboard_rpt_order, UNIT_REVENUE.VIEW, UNIT_REVENUE.[Duplicate?]
HAVING (((UNIT_REVENUE.VIEW)="2003ACT" Or (UNIT_REVENUE.VIEW) Is Null) AND ((UNIT_REVENUE.[Duplicate?]) Is Null Or (UNIT_REVENUE.[Duplicate?])=No))
ORDER BY [REF_Dashboard Base].dashboard_rpt_order;
The following returns records:
SELECT [REF_Dashboard Base].dashboard_rpt, [REF_Dashboard Base].dashboard_rpt_order, UNIT_REVENUE.VIEW, Sum(UNIT_REVENUE.jan_is) AS JAN03_IS, Sum(UNIT_REVENUE.feb_is) AS FEB03_IS, Sum(UNIT_REVENUE.mar_is) AS MAR03_IS, Sum(UNIT_REVENUE.apr_is) AS APR03_IS, Sum(UNIT_REVENUE.may_is) AS MAY03_IS, Sum(UNIT_REVENUE.jun_is) AS JUN03_IS, Sum(UNIT_REVENUE.jul_is) AS JUL03_IS, Sum(UNIT_REVENUE.aug_is) AS AUG03_IS, Sum(UNIT_REVENUE.sep_is) AS SEP03_IS, Sum(UNIT_REVENUE.oct_is) AS OCT03_IS, Sum(UNIT_REVENUE.nov_is) AS NOV03_IS, Sum(UNIT_REVENUE.dec_is) AS DEC03_IS, Sum(+[jan_is]+[feb_is]+[mar_is]+[apr_is]+[may_is]+[jun_is]+[jul_is]+[aug_is]+[sep_is]+[oct_is]+[nov_is]+[dec_is]) AS [Total IS], Sum(UNIT_REVENUE.YTD_03_IS) AS SumOfYTD_03_IS, Sum(UNIT_REVENUE.CUR_MO_03_IS) AS SumOfCUR_MO_03_IS, UNIT_REVENUE.[Duplicate?]
FROM UNIT_REVENUE INNER JOIN [REF_Dashboard Base] ON (UNIT_REVENUE.[DASHBOARD SO] = [REF_Dashboard Base].dashboard_rpt_order) AND (UNIT_REVENUE.DASHBOARD = [REF_Dashboard Base].dashboard_rpt)
GROUP BY [REF_Dashboard Base].dashboard_rpt, [REF_Dashboard Base].dashboard_rpt_order, UNIT_REVENUE.VIEW, UNIT_REVENUE.[Duplicate?]
HAVING (((UNIT_REVENUE.VIEW)="2003ACT" Or (UNIT_REVENUE.VIEW) Is Null) AND ((UNIT_REVENUE.[Duplicate?]) Is Null Or (UNIT_REVENUE.[Duplicate?])=No))
ORDER BY [REF_Dashboard Base].dashboard_rpt_order;
: Deb Koplen
deb.koplen@verizon.com
koplend@swbell.net (weekends and nights)
A person can stand almost anything except a succession of ordinary days.
The following returns NO CURRENT RECORD
SELECT [REF_Dashboard Base].dashboard_rpt, [REF_Dashboard Base].dashboard_rpt_order, UNIT_REVENUE.VIEW, Sum(UNIT_REVENUE.jan_is) AS JAN03_IS, Sum(UNIT_REVENUE.feb_is) AS FEB03_IS, Sum(UNIT_REVENUE.mar_is) AS MAR03_IS, Sum(UNIT_REVENUE.apr_is) AS APR03_IS, Sum(UNIT_REVENUE.may_is) AS MAY03_IS, Sum(UNIT_REVENUE.jun_is) AS JUN03_IS, Sum(UNIT_REVENUE.jul_is) AS JUL03_IS, Sum(UNIT_REVENUE.aug_is) AS AUG03_IS, Sum(UNIT_REVENUE.sep_is) AS SEP03_IS, Sum(UNIT_REVENUE.oct_is) AS OCT03_IS, Sum(UNIT_REVENUE.nov_is) AS NOV03_IS, Sum(UNIT_REVENUE.dec_is) AS DEC03_IS, Sum(+[jan_is]+[feb_is]+[mar_is]+[apr_is]+[may_is]+[jun_is]+[jul_is]+[aug_is]+[sep_is]+[oct_is]+[nov_is]+[dec_is]) AS [Total IS], Sum(UNIT_REVENUE.YTD_03_IS) AS SumOfYTD_03_IS, Sum(UNIT_REVENUE.CUR_MO_03_IS) AS SumOfCUR_MO_03_IS, UNIT_REVENUE.[Duplicate?]
FROM UNIT_REVENUE RIGHT JOIN [REF_Dashboard Base] ON (UNIT_REVENUE.[DASHBOARD SO] = [REF_Dashboard Base].dashboard_rpt_order) AND (UNIT_REVENUE.DASHBOARD = [REF_Dashboard Base].dashboard_rpt)
GROUP BY [REF_Dashboard Base].dashboard_rpt, [REF_Dashboard Base].dashboard_rpt_order, UNIT_REVENUE.VIEW, UNIT_REVENUE.[Duplicate?]
HAVING (((UNIT_REVENUE.VIEW)="2003ACT" Or (UNIT_REVENUE.VIEW) Is Null) AND ((UNIT_REVENUE.[Duplicate?]) Is Null Or (UNIT_REVENUE.[Duplicate?])=No))
ORDER BY [REF_Dashboard Base].dashboard_rpt_order;
The following returns records:
SELECT [REF_Dashboard Base].dashboard_rpt, [REF_Dashboard Base].dashboard_rpt_order, UNIT_REVENUE.VIEW, Sum(UNIT_REVENUE.jan_is) AS JAN03_IS, Sum(UNIT_REVENUE.feb_is) AS FEB03_IS, Sum(UNIT_REVENUE.mar_is) AS MAR03_IS, Sum(UNIT_REVENUE.apr_is) AS APR03_IS, Sum(UNIT_REVENUE.may_is) AS MAY03_IS, Sum(UNIT_REVENUE.jun_is) AS JUN03_IS, Sum(UNIT_REVENUE.jul_is) AS JUL03_IS, Sum(UNIT_REVENUE.aug_is) AS AUG03_IS, Sum(UNIT_REVENUE.sep_is) AS SEP03_IS, Sum(UNIT_REVENUE.oct_is) AS OCT03_IS, Sum(UNIT_REVENUE.nov_is) AS NOV03_IS, Sum(UNIT_REVENUE.dec_is) AS DEC03_IS, Sum(+[jan_is]+[feb_is]+[mar_is]+[apr_is]+[may_is]+[jun_is]+[jul_is]+[aug_is]+[sep_is]+[oct_is]+[nov_is]+[dec_is]) AS [Total IS], Sum(UNIT_REVENUE.YTD_03_IS) AS SumOfYTD_03_IS, Sum(UNIT_REVENUE.CUR_MO_03_IS) AS SumOfCUR_MO_03_IS, UNIT_REVENUE.[Duplicate?]
FROM UNIT_REVENUE INNER JOIN [REF_Dashboard Base] ON (UNIT_REVENUE.[DASHBOARD SO] = [REF_Dashboard Base].dashboard_rpt_order) AND (UNIT_REVENUE.DASHBOARD = [REF_Dashboard Base].dashboard_rpt)
GROUP BY [REF_Dashboard Base].dashboard_rpt, [REF_Dashboard Base].dashboard_rpt_order, UNIT_REVENUE.VIEW, UNIT_REVENUE.[Duplicate?]
HAVING (((UNIT_REVENUE.VIEW)="2003ACT" Or (UNIT_REVENUE.VIEW) Is Null) AND ((UNIT_REVENUE.[Duplicate?]) Is Null Or (UNIT_REVENUE.[Duplicate?])=No))
ORDER BY [REF_Dashboard Base].dashboard_rpt_order;
: Deb Koplen
deb.koplen@verizon.com
koplend@swbell.net (weekends and nights)
A person can stand almost anything except a succession of ordinary days.