Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple conditions in formula (logic?) 1

Status
Not open for further replies.

rharness

Technical User
Jul 2, 2007
29
US
CR Pro 10.0.0.533

I'm trying to show all instances of employees who've taken Defensive Driver Training. Unfortunately, quite a bit of this training has been entered into the database in various ways, with different course codes, and different class names.

I'm trying to get records selected with the following conditions:
1. Their registration status is Finished.
2. They've finished it within a certain number of years.
3. The appropriate codes are "HSI 340", "HSI 340B", OR "HSI 340C"
4. But NOT "HSI 700".
5. OR the course code can be anything else, as long as the word *defensive* in the class name, and the first two conditions are met.

Here's what one version of my formula looks like. I realize that my logic is just dumb, but I can't seem to figure out how to make this work, but it seems like it should be able to somehow.

{registration_style_view.Course_Code} = "HSI 340" or
{registration_style_view.Course_Code} = "HSI 340B" or
{registration_style_view.Class_Name} like "*defensive*" and
{registration_style_view.Registration_Status} = "F" and
{registration_style_view.Start_Date} > DateTime (2003, 12, 01, 08, 30, 00) and
{registration_style_view.Course_Code} <> "HSI 700"

Any suggestions/etc. appreciated!
-Roger Harness
 
You need to put parentheses around the OR piece of code. Also the last line is not needed as it is impossible for the course code to be one of the 2 you mentioned AND be another value at the same time. Please see the red items below:

[red]([/red]{registration_style_view.Course_Code} = "HSI 340" or
{registration_style_view.Course_Code} = "HSI 340B"[red]) and[/red]
{registration_style_view.Class_Name} like "*defensive*" and
{registration_style_view.Registration_Status} = "F" and
{registration_style_view.Start_Date} > DateTime (2003, 12, 01, 08, 30, 00)

I would expect this to work without the class_name logic as well.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Perfect, thank you dgillz!!

Obliged,

-Roger Harness
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top