Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Mulitple IF statements in a formula

Mulitple IF statements in a formula

Mulitple IF statements in a formula

I came across this a long time ago and I can't remember what I did for this to work. Basically in the below formula only the first line works. When the {APTCP.TRXTYPE}) = 51 it will display Payment but when its the second it displays nothing.
I can't remember what I am doing wrong. Thanks :)

if {APTCP.TRXTYPE}) = 51 then "Payment"
if {APTCP.TRXTYPE} = 57 then "PrePayment"
"Misc Payment"

RE: Mulitple IF statements in a formula

The code looks pretty correct (except for mismatched parans on the first line, which should give you an error).

RE: Mulitple IF statements in a formula

yah that extra ) isn't in my formula sorry. But it will work only on the first if statement

RE: Mulitple IF statements in a formula

YOu might want to add a null check at the beginning of the formula:

If isnull({table.field}) then
"" else
If ...

If that doesn't help, then please explain how you are using this formula and in what report section you are placing it.


RE: Mulitple IF statements in a formula

I was able to get the first two working. It had to do with my linking but now the third one will display the second ones result. I think I know the issue why but is there another formula to do it. If the record doesn't exist in the table aptcp I want it to return a value of MISC PAYMENT. What would be the formula?

RE: Mulitple IF statements in a formula

If isnull({aptcp.field}) then
"Misc Payment" else
If (etc.)

The null check must be first.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close