Solved query is too complex in access (1 Viewer)

hatmak

Registered User.
Local time
Today, 06:52
Joined
Jan 17, 2015
Messages
121
Hi all

i have query have many calculations when i put this formula

Tax_Year: IIf([Yearly_Pool_Tax]<=15000,0,(IIf([Yearly_Pool_Tax]<=30000,([Yearly_Pool_Tax]-15000)*0.025,IIf([Yearly_Pool_Tax]<=45000,([Yearly_Pool_Tax]-30000)*0.1+375,IIf([Yearly_Pool_Tax]<=60000,([Yearly_Pool_Tax]-45000)*0.15+1875,IIf([Yearly_Pool_Tax]<=200000,(([Yearly_Pool_Tax]-60000)*0.2)+4125,IIf([Yearly_Pool_Tax]<=400000,(([Yearly_Pool_Tax]-200000)*0.225)+32125,IIf([Yearly_Pool_Tax]>400000,(([Yearly_Pool_Tax]-400000)*0.25)+77125))))))))+IIf([Yearly_Pool_Tax]>1000000,12875,IIf([Yearly_Pool_Tax]>900000,7875,IIf([Yearly_Pool_Tax]>800000,4875,IIf([Yearly_Pool_Tax]>700000,2625,IIf([Yearly_Pool_Tax]>600000,375,0)))))

i have msg

query is too complex in access

what shall i do ?
his is formula for tax equation

but i made example in other database but it working as it
 

Attachments

  • Database1.accdb
    420 KB · Views: 95

plog

Banishment Pending
Local time
Today, 08:52
Joined
May 11, 2011
Messages
11,653
Make a custom function in a module. You pass it YearlyPoolTax, it does logic and returns the value.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:52
Joined
May 7, 2009
Messages
19,247
i make a table, tblRule, you review this table
and put the formula in "Expression".
the p in Expression field is the value
to be replaced in Query2 (see also this query).
 

Attachments

  • Database1 (11).accdb
    520 KB · Views: 104

hatmak

Registered User.
Local time
Today, 06:52
Joined
Jan 17, 2015
Messages
121
You are so amazing arnelgp

I am very grateful to you for helping me


many thanks 🥰🥰🥰
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:52
Joined
May 7, 2009
Messages
19,247
make sure you update tblRule with correct Expression.
because on Query2 that i made it is not computing
correctly.
 

Users who are viewing this thread

Top Bottom