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!

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

Jobs

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
http://www.kenhamady.com/

RE: Conditional formula, using Crystal 8.5

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

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!

Resources

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