×
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

Jobs

Convert String Value to Function?

Convert String Value to Function?

Convert String Value to Function?

(OP)
I've created a report in CR7 that will allow the users to determine the date range by which to return data.  The pick list values are strings that have the exact same text as the date range functions (LastFullMonth,YearToDate, Etc...).  Is there any way to convert the parameter string value to an actual function?  For example I'd like to select records as:

{table.datefield} in {?Reporting_Period}

I could always do something like:

If
  {?Reporting_Period} = 'LastFullMonth'
Then
  LastFullMonth
Else If
  (etc ...)

but this doesn't seem very efficient.  Any thoughts?

RE: Convert String Value to Function?

I think the nested if then is the only way.

Ken Hamady
http://www.kenhamady.com/
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.

RE: Convert String Value to Function?

You have more options with v8.5, but you are stuck with nested ifs with v8 and lower.

Malcolm Wynden
I'm for sale at http://wynden.net
malcolm@wynden.net

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