Print Page | Close Window

issue with formula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=7590
Printed Date: 03 May 2024 at 10:36am


Topic: issue with formula
Posted By: kirandb
Subject: issue with formula
Date Posted: 03 Sep 2009 at 11:48am
i am new to crystal reports using 2008 version. In the page header,i have to display the text "Quaterly" if my parameter PERIOD starts with Q ( i.e., Q12008) and should display "Monthly" if it starts with any other alphabet than Q (i.e., JAN_2008). How do I create a formula for this.
I created a formula and then in the formula tried adding
 
if [?]P_PERIOD(1)="Q" then "Quaterly" else "Monthly"
 
where P_PERIOD is the input  parameter
 
 
it is throwing an error saying
number,currency,amount,boolean,date-time or string is expected here
I dont know how to code this formula.
Please guide me.
 
Thanks,
Kiran


-------------
share your knowledge



Replies:
Posted By: Jyothi Yepuri
Date Posted: 03 Sep 2009 at 7:24pm

Try this
IF LEFT({?P_PERIOD},1) = 'Q' THEN
"Quaterly" else "Monthly"


Jyothi


Posted By: kirandb
Date Posted: 04 Sep 2009 at 6:06am
It works. Thanks

-------------
share your knowledge



Print Page | Close Window