N
Nona
The crosstab query below works. However, I would like to add the following
condition to the query:
TotInv: IIf([InvType]="Cost
Invoice",[TotNonUCRClaim],([ServCodeRate]*[UnitsUsed]))
However, when I add the condition, I get an error that says: "You tried to
execute a query that does not include the expression…as part of a aggregate
function."
TotInv: IIf([InvType]="Cost
Invoice",[TotNonUCRClaim],([ServCodeRate]*[UnitsUsed]))
This SQL for the query works fine until I try to add the condition:
TRANSFORM Sum([ServCodeRate]*[UnitsUsed]) AS TheValue
SELECT tblContracts.InvType, tblContracts.ContractName,
Sum([ServCodeRate]*[UnitsUsed]) AS TotInv
FROM (tblServicesProvided LEFT JOIN tblContracts ON
tblServicesProvided.ContractName = tblContracts.ContractName) LEFT JOIN
tblServCodes ON tblServicesProvided.ServCode = tblServCodes.ServCode
GROUP BY tblContracts.InvType, tblContracts.ContractName
PIVOT tblServicesProvided.CalMonth In
("July","August","September","October","November","December","January","February","March","April","May","June");
Is there anything I can do to make this work?
Thanks in advance!
condition to the query:
TotInv: IIf([InvType]="Cost
Invoice",[TotNonUCRClaim],([ServCodeRate]*[UnitsUsed]))
However, when I add the condition, I get an error that says: "You tried to
execute a query that does not include the expression…as part of a aggregate
function."
TotInv: IIf([InvType]="Cost
Invoice",[TotNonUCRClaim],([ServCodeRate]*[UnitsUsed]))
This SQL for the query works fine until I try to add the condition:
TRANSFORM Sum([ServCodeRate]*[UnitsUsed]) AS TheValue
SELECT tblContracts.InvType, tblContracts.ContractName,
Sum([ServCodeRate]*[UnitsUsed]) AS TotInv
FROM (tblServicesProvided LEFT JOIN tblContracts ON
tblServicesProvided.ContractName = tblContracts.ContractName) LEFT JOIN
tblServCodes ON tblServicesProvided.ServCode = tblServCodes.ServCode
GROUP BY tblContracts.InvType, tblContracts.ContractName
PIVOT tblServicesProvided.CalMonth In
("July","August","September","October","November","December","January","February","March","April","May","June");
Is there anything I can do to make this work?
Thanks in advance!