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!

Storing and using variables 2

Status
Not open for further replies.

rheard

Technical User
Jul 25, 2000
86
0
0
GB
Using Crystal X against CA-USD incident-logging database

Each incident or 'call' (in a call-ref table) has a link to the 'actions' table, and each call will have multiple actions during its lifetime (open, transfer assignee, log comment, field update, close call, being the most simple of these). Obviously, there could be many 'log comments' or 'transfer assignee' actions for each call.

My client wants a total list of all his team's open calls, and to see the latest record in the actions table for each call. That's easy, group on the call refnumber and just stick the required fields in the Group Header section - but he also wants to know the latest 'transfer' date of the call, which may or may not be the latest action.

So the question is, for each call, whenever the action is a 'transfer' can I store the action date and update it each time a transfer record is read, and use it to display in the report on the final record?

Ta for looking...
 
Use a global datevar

Create a formula and place where action type is evaluated.
If you do not want to see output just suppress it

@actiondate

whileprintingrecords;

global datevar actiondate;

If actiontype = 'transfer' then actiondate:= {actiondate.field};

In group footer place display formula

@display actiondate

whileprintingrecords;

global datevar actiondate;

Ian
 
I would set this up as a formula {@trans}:

If {table.actiontype} = 'transfer' then {table.actiondate}

Then go to report->selection formula->GROUP and enter:

{table.actiondate} = maximum({table.actiondate},{table.callID) or
{table.actiondate} = maximum({@trans},{table.callID})

This will return one or two records per call ID. Place both {@trans} and actiondate in the detail section and insert maximums on them at the call ID level, and then suppress the detail section and the group header.

-LB


 
Thanks guys, I'll try these later...
 
Thanks Lbass, worked a treat (I still don't profess to understand it, but it works.. :) ).

Ian, thanks for your time as well, I've got something else in mind to try your solution on...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top