Query Calculation - #Error

C

ckloch

I have a query that calculates tier amounts. the first tier
calculation displays #error. the next tier calculation displays
correctly and the calculated amounts are correct. The formula is as
follows....

Tier1Assets: IIf([fee query]!Assets<[fee query]![T1 Asset],[fee query]!
[T1 Asset],[fee query]!Assets)

This doesn't work either if you take the the source out and bracket
the fields...

Below is the SQL Query

SELECT [fee query].[Account Number], [Participant Charge]/4 AS
QrtPartCharge, IIf(([Participant Count]*[QrtPartCharge])+[Base
Fee]<([MinPartCharge]/4),[MinPartCharge]/4,(([Participant
Count]*[QrtPartCharge])+[Base Fee])) AS TotRecFees, [T1 Fee]/4 AS
T1Fee, [T2 Fee]/4 AS T2Fee, [T3 Fee]/4 AS T3Fee, [T4 Fee]/4 AS T4Fee,
[T5 Fee]/4 AS T5Fee, [T6 Fee]/4 AS T6Fee, IIf([Assets]<[T1 Asset],[T1
Asset],[Assets]) AS Tier1Assets, IIf(([Assets]-[T1 Asset])>[T2 Asset],
[T2 Asset],IIf(([Assets]-[T1 Asset])<0,0,([Assets]-[T1 Asset]))) AS
T2Assets, IIf(([Assets]-[T1 Asset]-[T2 Asset])>[T3 Asset],[T3
Asset],IIf(([Assets]-[T1 Asset]-[T2 Asset])<0,0,([Assets]-[T1 Asset]-
[T2 Asset]))) AS T3Assets, IIf(([Assets]-[T1 Asset]-[T2 Asset]-[T3
Asset])>[T4 Asset],[T4 Asset],IIf(([Assets]-[T1 Asset]-[T2 Asset]-[T3
Asset])<0,0,([Assets]-[T1 Asset]-[T2 Asset]-[T3 Asset]))) AS T4Asset,
IIf(([Assets]-[T1 Asset]-[T2 Asset]-[T3 Asset]-[T4 Asset])>[T5 Asset],
[T5 Asset],IIf(([Assets]-[T1 Asset]-[T2 Asset]-[T3 Asset]-[T4
Asset])<0,0,([Assets]-[T1 Asset]-[T2 Asset]-[T3 Asset]-[T4 Asset])))
AS T5Asset, IIf(([Assets]-[T1 Asset]-[T2 Asset]-[T3 Asset]-[T4 Asset]-
[T5 Asset])>[T6 Asset],[T6 Asset],IIf(([Assets]-[T1 Asset]-[T2 Asset]-
[T3 Asset]-[T4 Asset]-[T5 Asset])<0,0,([Assets]-[T1 Asset]-[T2 Asset]-
[T3 Asset]-[T4 Asset]-[T5 Asset]))) AS T6Asset, ([T1Fee]*[Tier1Assets])
+([T2Fee]*[T2Assets])+([T3Fee]*[T3Assets])+([T4Fee]*[T4Asset])+
([T5Fee]*[T5Asset])+([T6Fee]*[T6Asset]) AS [Total Asset Fee], [Total
Asset Fee]+[TotRecFees]+[Misc Fee 1 Amount]+[Misc Fee 2 Amount]-
[forfeitures] AS GrandTotal, IIf([Asset Charge]="Post",[Total Asset
Fee]*[PercentAssetPost],0)+IIf([Participant]="Post",
[TotRecFees]*[PercentPartPost],0) AS PdFromPlanAssets, [GrandTotal]-
[PdFromPlanAssets] AS InvAmt
FROM [fee query];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top