×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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

1 Formula For Different Products

1 Formula For Different Products

1 Formula For Different Products

(OP)
Using crystal version 14 with an MS SQL Table

This formula is going in the suppressed details section and then I have a summary in the group footer

I’m fairly certain I have done something like this before but today I just can’t get the syntax correct. Would appreciate your help. Wanting to have 1 formula to capture the sales dollars for 2 different products. I created this and it is erroring out.

My formula is:

IF {Acct#} = 272044716001 AND
{Product_#} in ["BP0021"] and
{Year} = 2019
THEN
{Sell Dollars}
ELSE 0

or


{Acct#} = 272044050000 AND
{Product_#} in ["WE33"] and
{Year} = 2019
THEN
{Sell Dollars}
ELSE 0

When I check the formula I’m told The remaining text does not appear to be part of the formula and highlights the last THEN {Sell Dollars}ELSE 0

What is the proper syntax for this assuming it can be done.

Thanks

RE: 1 Formula For Different Products

Use this syntax:

If
(
(
acctno=123 and
Prodno=“ABC”
) or
(
acctno=456 and
Prodno=“DEF”
)
) and
Year=2019 then
Sales$ else
0

-LB

RE: 1 Formula For Different Products

(OP)
Thanks Lbass, as usual you are spot on.

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! Already a Member? Login

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