Hi
I have the following condition in my report, its somewhat similar to what
i posted few days ago for displaying the selected dates.
"If date was not specified, then use the prior billing cycle,
if there is no prior billing cycle then use the last calendar month dates
otherwise use the date provided by the user"
The formulas used in the record selection formula as follows,
{?Criteria}
========================
It is the parameter which gets populated in crystal reprots if there is any date selected from application.
The application calls the report and is created in such a way that it populates this parameter automatically
through some business objects applications.
{@Curr_Cyc_Beg_Dt_w_Ind}
=========================
If
{ACCT.CYC_IN}='1'
Then
{ACCT.CYCBEG_DT}
Logic for prior billing cycle
===============================
DateAdd("d",1,{ACCT.CYCEND_DT})={@Curr_Cyc_Beg_Dt_w_Ind}
{@LastMonthBeginDate}
=========================
DateAdd('m',-1,CurrentDate-Day(CurrentDate)+1)
{@LastMonthEndDate}
=========================
CurrentDate-Day(CurrentDate)
So i used following in selection formula
If
InStr({?Criteria},'/')=0
Then
{ACCT.PTG_DT} IN
(If
DateAdd("d",1,{ACCT.CYCEND_DT})={@Curr_Cyc_Beg_Dt_w_Ind}
Then
{ACCT.CYCBEG_DT} To {ACCT.CYCEND_DT}
Else
{@LastMonthBeginDate} To {@LastMonthEndDate}
)
Else
True
But i am not getting the required CYCBEG_DT and CYCEND_DT when there is prior billing cycle.
Please let me know the solution.
Please reply to this.
Thanks
I have the following condition in my report, its somewhat similar to what
i posted few days ago for displaying the selected dates.
"If date was not specified, then use the prior billing cycle,
if there is no prior billing cycle then use the last calendar month dates
otherwise use the date provided by the user"
The formulas used in the record selection formula as follows,
{?Criteria}
========================
It is the parameter which gets populated in crystal reprots if there is any date selected from application.
The application calls the report and is created in such a way that it populates this parameter automatically
through some business objects applications.
{@Curr_Cyc_Beg_Dt_w_Ind}
=========================
If
{ACCT.CYC_IN}='1'
Then
{ACCT.CYCBEG_DT}
Logic for prior billing cycle
===============================
DateAdd("d",1,{ACCT.CYCEND_DT})={@Curr_Cyc_Beg_Dt_w_Ind}
{@LastMonthBeginDate}
=========================
DateAdd('m',-1,CurrentDate-Day(CurrentDate)+1)
{@LastMonthEndDate}
=========================
CurrentDate-Day(CurrentDate)
So i used following in selection formula
If
InStr({?Criteria},'/')=0
Then
{ACCT.PTG_DT} IN
(If
DateAdd("d",1,{ACCT.CYCEND_DT})={@Curr_Cyc_Beg_Dt_w_Ind}
Then
{ACCT.CYCBEG_DT} To {ACCT.CYCEND_DT}
Else
{@LastMonthBeginDate} To {@LastMonthEndDate}
)
Else
True
But i am not getting the required CYCBEG_DT and CYCEND_DT when there is prior billing cycle.
Please let me know the solution.
Please reply to this.
Thanks