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!

Display Time Frame in Alternate format 1

Status
Not open for further replies.

sumgait

Programmer
Jun 14, 2001
21
0
0
CA
I have created a Crystal report with parameters that ask the user to select a time frame:

1. Calendar1stQtr.
2. Calendar2ndQtr.
3. Calendar3rdQtr.
4. Calendar4thQtr.

On the header of my report I want to place some text that says:

FOI Periodic Summary Report for the period of <insert selected parameter field>.

When a user say selects Calendar1stQtr I want the text inserted into the above to say something like:

FOI Periodic Summary Report for the period of <January 1 - March 31, 2005>.


How do I do this?

I have created a formula called frmDisplayReportingPeriod shown below:

If {?parReportingPeriod} = "Calendar1stQtr" Then
"January 1 - March 31, 2005"
Else
If {?parReportingPeriod} = "Calendar2stQtr" Then
"April 1 - June 30, 2005"
Else
If {?parReportingPeriod} = "Calendar3stQtr" Then
"July 1 - September 30, 2005"
Else
If {?parReportingPeriod} = "Calendar4stQtr" Then
"October 1 - December 31, 2005"


I insert this formula into the FOI text above and if the user does select "Calendar1stQtr" as a parameter field, the correct text does get displayed - ie
January 1 - March 31, 2005.

However if a user selects another calendar period it does not seem to change - it looks like my formula hard codes the Calendar1stQtr.

Can anyone suggest how I can change this?

Thanks

John Falloon
 
It looks like it should work. Note that your formula uses incorrect options: 1st, 2st, 3st, 4st. If you correct these, it should work.

-LB
 
Thanks for the syntax check. I made the correct changes and the text now inserts correctly!

Thanks again lbass for the "extra set of eyes"!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top