Conernesto
asked on
Query Expression for contentents of a field except some values
I have a table called Accounts. The table has two fields Accounts and Amounts. I am creating a query and need an expression that pulls amounts if the account is not account 1 or 5. Below is a sample of what I need. How do I write the expression?
Accounts Amounts Query Result wanted
1 100 0
2 200 200
3 300 300
4 400 400
5 500 0
conernesto
Accounts Amounts Query Result wanted
1 100 0
2 200 200
3 300 300
4 400 400
5 500 0
conernesto
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can you provide the formula to enter the above in an expression since I will need to do more with this? For Example: Xpression: IIF([Account_tbl]![Account ]?????.
That's part of the SQL statement....
The expression is:
You can assign it a column name like this:
(You can toggle between SQL view and Design view to see it written both ways)
The expression is:
IIF(Account= 1 OR Account = 5, 0, Amount)
You can assign it a column name like this:
NewAmount: IIF(Account= 1 OR Account = 5, 0, Amount)
(You can toggle between SQL view and Design view to see it written both ways)
ASKER
1 100 0
2 200 200
3 300 300
4 400 400
5 500 0
The above is to clerify.