evaluating a range

5 pts.
Tags:
Lookup
Programming
SQL
I am trying to evaluate a formula to return a statement if true. I am having trouble with the syntax. I am working out the number of years service for staff using the formula currentdate-{employment date}/365 What I want to evaludate is whether the result is between 5 and 6. If true I want the statement :"Elgible" to appear in the report. I've tried using an IiF and BETWEEN statement, but continue getting the message "The ) is missing" on the between. My formula looks like: Iif ( BETWEEN ( CurrentDate-{Employee.Employment Date}/365), 5, 6 ) , "Eligible" , NULL ) Can anyone please advise what I am doing wrong? What would be the best approach. If this was excel I would use a Vlookup table specifying the ranges and return values. But crystal does not have a vlookup function.

Answer Wiki

Thanks. We'll let you know when a new response is added.

You have unmatched parenthesis in this line:
<pre>
Iif <b>(</b> BETWEEN<b> (</b> CurrentDate-{Employee.Employment Date}/365<b>)</b>, 5, 6 <b>)</b> , “Eligible” , NULL )</pre>

Was this a typo ?

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following