×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*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.

# Conditional formula, using Crystal 8.5

## Conditional formula, using Crystal 8.5

(OP)
Hello!

Here's my (super simple) formula:
if {oeordlin_sql.item_no} startswith "3.10" then "Blue instruction sheet enclosed." else
if {oeordlin_sql.item_no} startswith "2.10" then "Yellow instruction sheet enclosed."

I need a third condition, where if an order contains more than one item, and just so happens to have items that start with both 2.1 and 3.1, I need this formula to return "Includes both blue and yellow instruction sheets".

I'm sure this is easy for y'all, but I'm stumped!

Thanks,
Joy

### RE: Conditional formula, using Crystal 8.5

Actually this is tricky because you are mixing item level and order level conditions. It sounds like this should be all moved to the order level. First, create two new formulas:

//{@Cond 3.1}
if {oeordlin_sql.item_no} startswith "3.10" then 1 else 0

//{@Cond 2.1}
if {oeordlin_sql.item_no} startswith "2.10" then 1 else 0

Then your existing formula should be changed to:

If Sum ({@Cond 3.1}, {Your.OrderNoField}) > 0 and Sum ({@Cond 2.1}, {Your.OrderNoField}) > 0
then "Includes both blue and yellow instruction sheets"
else
If Sum ({@Cond 3.1}, {Your.OrderNoField}) > 0
then "Blue instruction sheet enclosed."
else
If Sum ({@Cond 2.1}, {Your.OrderNoField}) > 0
then "Yellow instruction sheet enclosed."
else ""

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks

### RE: Conditional formula, using Crystal 8.5

(OP)
This worked perfectly, and I learned something!!! Thank you so much

#### 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.

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:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!