R
ryguy7272
I'm trying to set up a query to count by items in a certain field named 'IO'.
This count function was working until I added a total of four of
calculations to the end of my query. Now, the query will no longer count by
Advertiser IO. Actually, some IOs are counted and, arranged almost like a
subtotal in Excel. Others, however, simply display a 1 in the IO field and
the Advertiser name is displayed multiple times, with 1's several rows down
in the adjacent IO field.
My SQL is below.
SELECT C2_UnionQuery2008.RVP, C2_UnionQuery2008.Director,
C2_UnionQuery2008.SalesRep, C2_UnionQuery2008.Advertiser,
Count(C2_UnionQuery2008.IO) AS CountOfIO, Sum(C2_UnionQuery2008.OCT) AS
SumOfOCT, Sum(C2_UnionQuery2008.NOV) AS SumOfNOV, Sum(C2_UnionQuery2008.DEC)
AS SumOfDEC, Sum(C2_UnionQuery2008.Q408) AS SumOfQ408,
Sum(C2_UnionQuery2008.Current_Revenue) AS [Current Revenue],
IIf([NOV]>0,[C2_UnionQuery2008]![Current_Revenue]/[C2_UnionQuery2008]![NOV],0)
AS [MTD Delivery], [MTD Delivery]/[Date]*92 AS [Proj Delivery],
Sum([OCT]+[NOV]*[Proj Delivery]+[DEC]*[Proj Delivery]) AS [Qtr Proj]
FROM C2_UnionQuery2008
GROUP BY C2_UnionQuery2008.RVP, C2_UnionQuery2008.Director,
C2_UnionQuery2008.SalesRep, C2_UnionQuery2008.Advertiser,
IIf([NOV]>0,[C2_UnionQuery2008]![Current_Revenue]/[C2_UnionQuery2008]![NOV],0), [MTD Delivery]/[Date]*92;
I think the solution that I am after is being thrown off by the 'Group By'
in the 'MTD Delivery:' field and the 'Group By' in the 'Proj Delivery:'
field.
There must be some kind of loophole or a way around this. Can someone
please help me with this?
Thanks so much,
Ryan---
This count function was working until I added a total of four of
calculations to the end of my query. Now, the query will no longer count by
Advertiser IO. Actually, some IOs are counted and, arranged almost like a
subtotal in Excel. Others, however, simply display a 1 in the IO field and
the Advertiser name is displayed multiple times, with 1's several rows down
in the adjacent IO field.
My SQL is below.
SELECT C2_UnionQuery2008.RVP, C2_UnionQuery2008.Director,
C2_UnionQuery2008.SalesRep, C2_UnionQuery2008.Advertiser,
Count(C2_UnionQuery2008.IO) AS CountOfIO, Sum(C2_UnionQuery2008.OCT) AS
SumOfOCT, Sum(C2_UnionQuery2008.NOV) AS SumOfNOV, Sum(C2_UnionQuery2008.DEC)
AS SumOfDEC, Sum(C2_UnionQuery2008.Q408) AS SumOfQ408,
Sum(C2_UnionQuery2008.Current_Revenue) AS [Current Revenue],
IIf([NOV]>0,[C2_UnionQuery2008]![Current_Revenue]/[C2_UnionQuery2008]![NOV],0)
AS [MTD Delivery], [MTD Delivery]/[Date]*92 AS [Proj Delivery],
Sum([OCT]+[NOV]*[Proj Delivery]+[DEC]*[Proj Delivery]) AS [Qtr Proj]
FROM C2_UnionQuery2008
GROUP BY C2_UnionQuery2008.RVP, C2_UnionQuery2008.Director,
C2_UnionQuery2008.SalesRep, C2_UnionQuery2008.Advertiser,
IIf([NOV]>0,[C2_UnionQuery2008]![Current_Revenue]/[C2_UnionQuery2008]![NOV],0), [MTD Delivery]/[Date]*92;
I think the solution that I am after is being thrown off by the 'Group By'
in the 'MTD Delivery:' field and the 'Group By' in the 'Proj Delivery:'
field.
There must be some kind of loophole or a way around this. Can someone
please help me with this?
Thanks so much,
Ryan---