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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select on parameter values 1

Status
Not open for further replies.

smil3y

IS-IT--Management
Jan 8, 2004
79
0
0
AU
I am using VB6 to pass two datetime parameters to a crystal reports (8.5)main report. This works fine.
I then have a sub report that I also pass these two date parameters to. The dates are a startdate and enddate.

The sub report is connected to a table with a date field and I have selected both date parameters as linking to the sub report date field. I can successfully display the date parameters in the sub report but I am unable to get any filtering formula to work. I simply want the sub report date field to be between the parameter startdate and enddates.

Is it OK to link the sub report date field to both parameters? If so how do I get a filter to work using the parameters in a formula.
Regards
 
Right, link both parameters to the date field, go into the subreport->Report->Selection Formula->Record and edit the = to be >= and <= accordingly.

-k
 
I tried this but get the following error when I check the formula:

This array must be subscripted. For example : Array[|]

I have cut back to just one parameter and used as follows: Purchase.date = {?PM-?PRStartDate} - this works fine.
Purchase.date >= {?PM-?PRStartDate} - this fails.

I do not see why the equals formula works and the other does not. I thought maybe itmight be that the Purchase.date field is a date field while the parameter is a date/time field but this would still not explain why one formula works and the other does not.

Any suggestions?
 
I think an array message implies that you have the parameter set up for multiple values. You might check that and change that to "false".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top