Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Set default From Date and To Date parameter in Crystal report 2008

Hi All!

I have two parameters From Date and To Date in Crystal Report 2008 and I want to set the default value for them like:

From Date is the first day of current year (1/1/2011) and To Date is Currentdate.

When Refresh all time, I want them to remember these values.

I know that in crystal report 2008, when I refresh the report, it remembers the value I choose the last time of previewing the report. It didn't show the default value. How can I set the default value as I described above?

If there is something unclear, I'll talk to you soon.

Best Regards,

Ketya

Edited by: ketya007 on May 20, 2011 3:19 PM

Former Member
Former Member replied

Hi,

Someone sent me a message asking how I went about this. So here is a baisc example. This is again done in select expert....

if {?Start Date} <= date("01/01/2000") then

(

date({IT_ChangeManagement.Deployment Date/Time}) = currentdate

)

else

(

{IT_ChangeManagement.Deployment Date/Time} >= {?Start Date} and

{IT_ChangeManagement.Deployment Date/Time} <= {?End Date}

)

In your case it would be more like.

if {?Start Date} <= date("01/01/2000") then

(

{IT_ChangeManagement.Deployment Date/Time} in YearToDate

)

else

(

{IT_ChangeManagement.Deployment Date/Time} >= {?Start Date} and

{IT_ChangeManagement.Deployment Date/Time} <= {?End Date}

)

If you wanted to use a parameter prompting the user for a default it would be

if {?Default Param} = "YES" then

(

{IT_ChangeManagement.Deployment Date/Time} in YearToDate

)

else

(

{IT_ChangeManagement.Deployment Date/Time} >= {?Start Date} and

{IT_ChangeManagement.Deployment Date/Time} <= {?End Date}

)

Make sense?

Anyways Jason is probably correct, this method I am doing is more of a work around...but that's how I have handled it for years.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question