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!

Formula to add minutes from a datediff function 1

Status
Not open for further replies.

johnstrang

Technical User
Dec 8, 2003
60
CH
Hi,

I have what should be an easy question, but is proving difficult.
All I want is the sum of the minutes from this formula (@act_time):
Code:
whileprintingrecords ;
if PreviousIsNull ({HPD_ACTIONS.CASE_ID}) then 0 
else
(
if {HPD_ACTIONS.CASE_ID} = previous({HPD_ACTIONS.CASE_ID})
and (previous ({HPD_ACTIONS.GROUP_NAME}) = {?Team} )
then
DateDiff ("n",previous({@action_time}) , {@action_time})
)

The aim is to get the total amount of time spend on different cases by the team specified in the parameter {?Team}.

I have tried grouping on the field {HPD_ACTIONS.CASE_ID} but that made no difference.

If anyone can help it will my Friday so much better :)

Thanks,
John
 
Because you are using the previous function, you can't insert a summary, so instead you would use a variable. If you have no groups, then create two formulas:

//{@sumacttime} to be placed in the detail section:
whileprintingrecords;
numbervar sumacttime := sumacttime + {@act_time};

//{@display} to be placed in the report footer:
whileprintingrecords;
numbervar sumacttime;

-LB
 
Thanks LB - I just could not work out why I was unable to use a summary. I know that my function {@act_time} returned a number so I thought I should be able to apply a summary to that number.

I've already moved on to using a running total - thanks also for providing sample formulas :)

Best regards, enjoy the weekend!

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top