• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

MS ACCESS/SQL Question

JJChicken

Diamond Member
Hoping you geniuses can help me out.

I have a database

Account............Description..................Dollar_Amount
1.........................Transaction A................500
2.........................Transaction B................300
2.........................Transaction C................800
1.........................Transaction D................10
1.........................Transaction E................1000

I want build a query that returns all rows where

absolute value(dollar_amount) > 10% absolute value(sum total for the account)

E.g. In the above, it will output:

1.........................Transaction A................500
2.........................Transaction B................300
2.........................Transaction C................800
1.........................Transaction E................1000

Transaction D will get left out because 10 < 10% of 1510 (sum total for account 1).

Does anyone know how to achieve this? Do I need to resort to expressions?
 
I'd just use a simple subquery.

select * from table t where (dollar_amount * 10) >= (select sum(dollar_amount) from table where account = t.account)
 
Back
Top