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

oldest date 1

Status
Not open for further replies.

bridgebum1

IS-IT--Management
Jan 7, 2010
3
US
Using crystal reports 8.5
Looking for a new customer who has ordered within a date range (thru a parameter field}
I have set up a group for the customer and am able to use the min function thru insert to get the oldest one within that range--this all works fine. I need however to then hide the customer if this customer has EVER purchased before-ie I only want to show new customers-those who have no entries prior to the range I have entered. Can the min function in the group header/footer be used as a record selector or can a subreport do this?
 
You could allow all records in and use the parameter range to suppress all earlier records instead of using it in the selection formula.

Or you could create a SQL expression {%mindate} like this:
(
select min(A.`date`)
from table A
where A.`custID` = table.`custID`
)

Then use a record selection formula like this:

{%mindate} >= minimum({?daterange}) and
{table.date} = {?daterange}

-LB
 
I allowed all records in, but when i try to place the parameter field in the (x-2) suppress box in the detail section it works if I do {qhead.qhdtdu}={?duedate} which is my parameter field but if I try to say <= it returns 'this array must be subscripted. For example: Array[1].'
This is the same error I got when playing around with the original record selection.
 
It sounds like you have set the parameter to allow multiple range values. If that isn't what you intended, then go into parameter->edit and uncheck "allow multiple values".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top