cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports Date Parameter

Former Member
0 Kudos

I have a report with multiple subreports. I need to add a parameter in the main report that links to the subreports with a date that is not dynamic. I am wanting the user to be able to enter a date in the format of MM/DD/YYYY and pull all values from the database field that are greater than or equal to the date they request.

Every time I am on the main report and try to change the link to the parameters on the subreport, it wipes out anything I enter in the "Select data in subreport based on field". If I make the assumption that it saves it correctly and I go to the subreport and use the Select Expert to try to add another criteria to limit the data displayed, the parameter is not a valid option to set the field equal to. Instead I have all of the dynamic values from the database as options. All I want is to set the values in the field greater than or equal to the parameter the user enters.

Does anyone know what I have to do to accomplish this? I'm at my wits end on this one.

Thanks in advance for your replies.

Accepted Solutions (1)

Accepted Solutions (1)

former_member292966
Active Contributor
0 Kudos

Hi Paula,

If your subreport does not have a field that matches the same type as the parameter field, you cannot link it.

I've gotten around this problem by creating a formula in the subreport that returns the same datatype as the parameter. In your case, just create a formula and use Today. You should be able to link on this formula now and then go into the Record Selection Formula to use the parameter how you need.

Good luck,

Brian

Former Member
0 Kudos

Brian,

Thank you for your reply. I already have a field that is the same data type. I'm still stuck on the issue of getting the parameter to take a date the user enters, rather than displaying values from the database.

If you have any other suggestions, I'd love to hear them.

Thanks,

Paula

Answers (1)

Answers (1)

Former Member
0 Kudos

Try linking the dynamic parameter from main report to subreport by right clicking on the subreport ang go to change subreport links and select the dynamic parameter and select the parameter from subreport and uncheck the option database fields from subreport.

Now edit the subreport and go to record selection fromula and write like this

>={?Parameter}

Regards,

Raghavendra

Former Member
0 Kudos

Thank you for the information. This is what I was doing before I logged this question. My problem is that I don't want to fill the selection of the parameter with the values from the database table. I want the user to enter a date of their choice and let it pull from all values in the field that are greater than or equal to the parameter.

Do you have any other suggestions?