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

Less than Maximum(dtCreation)

Status
Not open for further replies.

pleashelp

Technical User
Feb 27, 2002
97
US
I am using CR 9.0 and have a sticky problem! I need to select only the records that are less than the maximum of a date field dtCreation, and are less than my parameter
{?EndDate}.

I have tried putting it in the Select statement, but I get an error that says this must be evaluated later.

Any ideas??

Thanks
 
I might be missing the point, but won't all records inherently be less than the maximum of the dtCreation field?

What are you actually trying to accomplish with this criteria? You could simply select all records where {table.datefield} <= {?EndDate}, which would return what you've indicated you need.

Please consider posting a bit more technical information and your business requirements if you need a better answer.
 
If you mean that you need to select only those dates less than the maximum creation date in the database and which are less than your parameter date, then do not use a record select on the date field. Instead, go to report->edit selection formula->GROUP and enter:

{table.dtCreation} < maximum({table.dtCreation},{table.grpfield}) and
{table.dtCreation} < {?EndDate}

...where {table.grpfield} is a field you are grouping on. If you have no groups, you can eliminate that clause.

If instead you used {?EndDate} in the record select, you could only exclude the maximum record that was returned by that select, which might not be the maximum one in the database.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top