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

Showing most recent record only... 1

Status
Not open for further replies.

mmaz

Programmer
Nov 22, 2000
347
Hi,

I'm trying to display the id of the most recent db record. I'm using CR 8.0 & ODBC for Remedy.

I've included this condition in the select expert:

{table.myDate} = Maximum({table.myDate})

but I get the following error message:

"This function cannot be used because it must be evaluated later."

Help!!
 
In order to use aggregate functions like Maximum you need to create groups. Until Crystal (actually SQL) examines all of the records in the group (such as customer id), it can't know what is the last order date, the largest order in dollars, etc. Brian J. Alves
Terrier Consulting, Inc.
Email: brian.alves@worldnet.att.net
VB / Crystal / SQLServer
 
I have created groups and still got the same error message. Is there any easy way I can do this? I just want to display the latest record...

Thanks!
 
One way to do it is:

Create a formula that does a Maximum(date field) and place it at the appropriate group level. Remove the SELECT condition.

Or: use the Group Selection expert Brian J. Alves
Terrier Consulting, Inc.
Email: brian.alves@worldnet.att.net
VB / Crystal / SQLServer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top