Does anyone know how to make this SQL Server qry run in Access?
SELECT Destination, CallType, ContractName, ICNumber, SUM(Calls) AS SumOfCalls, SUM(Minutes) AS SumOfMinutes, SUM(DollarCharge) as SumOfDollarCharge, SUM(DollarCharge)/SUM(Minutes) AS DollarCPM
FROM DATA
GROUP BY Destination, ContractName, ICNumber, CallType WITH CUBE
HAVING (grouping(Destination) = 0 AND grouping(ContractName) = 0 AND grouping(ICNumber) = 0 AND grouping(CallType) = 0) OR (grouping(Destination) = 0 AND grouping(ContractName) = 1 AND grouping(ICNumber) = 1 AND grouping(CallType) = 0) OR (grouping(Destination) = 1 AND grouping(ContractName) = 1 AND grouping(ICNumber) = 1 AND grouping(CallType) = 0)
ORDER BY DESTINATION DESC, CALLTYPE, CONTRACTNAME DESC
Thanks....
SELECT Destination, CallType, ContractName, ICNumber, SUM(Calls) AS SumOfCalls, SUM(Minutes) AS SumOfMinutes, SUM(DollarCharge) as SumOfDollarCharge, SUM(DollarCharge)/SUM(Minutes) AS DollarCPM
FROM DATA
GROUP BY Destination, ContractName, ICNumber, CallType WITH CUBE
HAVING (grouping(Destination) = 0 AND grouping(ContractName) = 0 AND grouping(ICNumber) = 0 AND grouping(CallType) = 0) OR (grouping(Destination) = 0 AND grouping(ContractName) = 1 AND grouping(ICNumber) = 1 AND grouping(CallType) = 0) OR (grouping(Destination) = 1 AND grouping(ContractName) = 1 AND grouping(ICNumber) = 1 AND grouping(CallType) = 0)
ORDER BY DESTINATION DESC, CALLTYPE, CONTRACTNAME DESC
Thanks....