IIF Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am new to creating Access queries.
I would like to change the Amount to -ve/+ve number if its a Credit/Dedit.
For example:
If DR_CR is C then Trans Amount should be formated as negative number.

How do I do this? should it be a expression, a code?
Should I create this in query or report?

Please help.
Thank you
Pon
 
I am new to creating Access queries.
I would like to change the Amount to -ve/+ve number if its a Credit/Dedit.
For example:
If DR_CR is C then Trans Amount should be formated as negative number.

How do I do this? should it be a expression, a code?
Should I create this in query or report?

Please help.
Thank you
Pon

In a query....
NewValue:IIf([DR_CR]= "C",[TransAmount]*-1,[TransAmount])

Use the NewValue field in your report.

Directly in a Report.... (using an Unbound text control) ....
= IIf([DR_CR]= "C",[TransAmount]*-1,[TransAmount])
 
Thank you very much.
My query and report both worked with the help of your IIF statement.
Pon.

fredg said:
I am new to creating Access queries.
I would like to change the Amount to -ve/+ve number if its a Credit/Dedit.
For example:
If DR_CR is C then Trans Amount should be formated as negative number.

How do I do this? should it be a expression, a code?
Should I create this in query or report?

Please help.
Thank you
Pon

In a query....
NewValue:IIf([DR_CR]= "C",[TransAmount]*-1,[TransAmount])

Use the NewValue field in your report.

Directly in a Report.... (using an Unbound text control) ....
= IIf([DR_CR]= "C",[TransAmount]*-1,[TransAmount])
 

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

Similar Threads

IIF statement format percent 6
Subtracting 2fields from 1 field in query 2
Time Calculation 2
Group By error message 2
query to pull records based of subquery column 10
IIF statement 6
IIF function with * 7
Access Query problem 1

Back
Top