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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert String Value to Function?

Status
Not open for further replies.

rhinok

Technical User
Joined
Mar 21, 2001
Messages
749
Location
US
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?
 
I think the nested if then is the only way. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
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 malcolm@wynden.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top