I have an append query that does not append the value of a field that is caluclated from two other fields in the query. the query works well as a SELECT query but when I then switch it to an append query, choose the destinated fields, but I leave some fields blank, not appending to a destination field and I get an error.
This is what I have done:
INSERT INTO tblCommissionPayout ( [Date], RepIDNo, RepName, TotalMargin, NonEligGTM, [EligMargin$], TotalPay )
SELECT tblCommissionData.RunDate, tblCommissionData.SalesRepNo, tblCommissionData.SalesRepName, Sum(tblCommissionData.[Marg$]) AS [TotalMarg$], Sum(IIf([Bonus]="No",[Marg$],0)) AS NonEligibleGTM, [TotalMarg$]-[NonEligibleGTM] AS [GTMBal$], [BonusGTM1]+[BonusGTM2] AS TotalBonus
FROM tblCommissionData
GROUP BY tblCommissionData.RunDate;
But the BonusGTM1 and BonusGTM2 are calculated fields in my query. But they don't show up since I don't have them assigned going anywhere. Is there any way to do this? Any help is apreciated
The greatest risk, is not taking one.
This is what I have done:
INSERT INTO tblCommissionPayout ( [Date], RepIDNo, RepName, TotalMargin, NonEligGTM, [EligMargin$], TotalPay )
SELECT tblCommissionData.RunDate, tblCommissionData.SalesRepNo, tblCommissionData.SalesRepName, Sum(tblCommissionData.[Marg$]) AS [TotalMarg$], Sum(IIf([Bonus]="No",[Marg$],0)) AS NonEligibleGTM, [TotalMarg$]-[NonEligibleGTM] AS [GTMBal$], [BonusGTM1]+[BonusGTM2] AS TotalBonus
FROM tblCommissionData
GROUP BY tblCommissionData.RunDate;
But the BonusGTM1 and BonusGTM2 are calculated fields in my query. But they don't show up since I don't have them assigned going anywhere. Is there any way to do this? Any help is apreciated
The greatest risk, is not taking one.