×
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

Multiple Conditions for record select, not apparent in Select Expert

Multiple Conditions for record select, not apparent in Select Expert

Multiple Conditions for record select, not apparent in Select Expert

(OP)
Hi,

I'm running Crystal Reports 2011 and need to restrict my report results based on two conditions.  I cannot figure out how to apply both of these conditions in Select Expert.

I have employee status records that are either "Full Time" or "Terminated".  The "Full Time" records have a null termination date field, and the "Terminated" records have the applicable termination date.

For my report, I would like to select only the "Full Time" employee records, as well as the "Terminated" employee records AS LONG AS the termination date is within the past 12 months (for example, I am now trying to run a report for November that takes into consideration all full-time employees and employees that were terminated on or after November 1, 2010.)

Any suggestions would be greatly appreciated!!

RE: Multiple Conditions for record select, not apparent in Select Expert


Often you exceed the ability of the Select Expert to do what you want, and you can never use it with an Or clause.

In the Select Expert, with no conditions defined, click the Formula Editor button. Your formula will be something very similar to this:

{yourtable.Status} = "Full Time"
or
({yourtable.Status} = "Terminated" and {yourtable.terminationdate} >= date(year(currentdate) - 1,month(currentdate),1)

Technically speaking you don't need to test for terminated status since the only records with term dates are for terminated employees. I'd leave it in anyway.

 

RE: Multiple Conditions for record select, not apparent in Select Expert



Think I left off the closing paren:

{yourtable.Status} = "Full Time"
or
({yourtable.Status} = "Terminated" and {yourtable.terminationdate} >= date(year(currentdate) - 1,month(currentdate),1))

 

RE: Multiple Conditions for record select, not apparent in Select Expert

You can also just go directly to report->selection formula->record and enter your formula directly there, bypassing the select expert altogether. I personally never use it.

-LB

RE: Multiple Conditions for record select, not apparent in Select Expert

(OP)
Thanks so much for your responses.  I will give this a try.

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