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!

Retrieving previous fields, then passing formula to server.

Status
Not open for further replies.

Flopper

Technical User
Jan 19, 2001
140
AT
Hola,

Is it possible to create a formula (without using the Previous function), that will capture a previous field, and enable the result of the formula to be passed from the selection criteria to the server. I'm using Crystal 9, ODBC, and a Progress database.

I've attempted to create formulas using variables but they all seem to require whileprintingrecords statements and thus cannot be passed to the database.

If this sounds confusing i'll explain in further detail:

I'm using an in-house call centre application and the data could look like the following:

ID Status
001 No answer
003 No answer
004 Engaged
005 Despatched
007 At Scene
008 Pick-Up
009 Completed

I'm attempting to flag all of the calls previous to, and including, the Despatched status, and retrieving only these records from the database. The ID is an incremented number and thus any numbers higher than the Despatched status can be discarded.

I need to pass the formula to the server as i need to create a number of variable running totals on the groups above this detail line, using fields from detail and group sections.

If anyone can help it'd be greatly appreciated.

Cheers
 
If you have the option of using SQL expressions, you could create one like {%despatchedID}:

(select max(AKA.`ID`) from Table AKA where
AKA.`groupfield` = Table.`groupfield` and
AKA.`Status` = 'Despatched')

Substitute your table name for "Table", and your exact field names for "ID","Status", and "groupfield"--the clause relating to the groupfield assumes you have a group. If you have more than one, you would need to add a second clause. You might also need to adapt this if you have record selection criteria.

Then go to report->edit selection formula->RECORD and enter:

{table.ID} <= {%despatchedID}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top