Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Topic: If Then Else - Not Working Posted: 18 Jul 2017 at 11:30am
I have this formula that I am trying and have moved my parens many different ways, yet I continue to get an error that says The ) is missing and it highlights the 2nd If line (AUTHS.
If {AUTHS.ReferralType} = "HPC" and ({AuthStatusMaster.AuthStatus}) = "AHPCE" Then "HPC New"
Else
If (AUTHS.ReferralType} = "HPC" and ({AUTHS.Status}) = "Pended" Then "HPC Ongoing"
Else
If {AUTHS.ReferralType} = "HPC" and ({AuthStatusMaster.AuthStatus}) = "AHPCC" Then "HPC Completed"
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 18 Jul 2017 at 12:26pm
These are all AND conditions so you should not need any parenthesis in that code
If {AUTHS.ReferralType} = "HPC" and {AuthStatusMaster.AuthStatus} = "AHPCE" Then "HPC New"
Else
If (AUTHS.ReferralType} = "HPC" and {AUTHS.Status} = "Pended" Then "HPC Ongoing"
Else
If {AUTHS.ReferralType} = "HPC" and {AuthStatusMaster.AuthStatus} = "AHPCC" Then "HPC Completed"
Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Posted: 18 Jul 2017 at 12:44pm
I just realized my silly mistake and that I need some new glasses or a larger monitor. When I copied your formula into my report, I still got the same error and realized it is a ( in that 2nd line rather than the {.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Posted: 21 Jul 2017 at 11:12am
Just as an added note...If none of the conditions are met, what is returned? I think it is an empty string.
A final ELSE statement with an message might help debug. Of course if you want it be empty if none of the conditions are met, then it is perfect.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum