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

Resetting Formula on change on group

Status
Not open for further replies.

ekta22

IS-IT--Management
May 3, 2004
359
US
Hi,

I have a formula that displays the record number for records being displyed on the report. It works fine but I want it to reset on change of the group. How can I do it in the formula below.
I tried incorporating the formula in Running total but it does not like the variable in there. This is the formula that I have

Code:
WhilePrintingRecords;
numberVar a;

if

{#rec-count}=0 OR
(    {P_60403.FAC_IDENT} = Previous ({P_60403.FAC_IDENT}) AND 
    {P_60403.LOG_ID}=Previous ({P_60403.LOG_ID}) 
)    
 OR

( {P_60403.LOG_STATUS}<>"O" AND 
  
   Not(isNull({P_60403.BACKUP_START_DATE}) )  AND  {P_60403.BACKUP_SYSTEM}<>"D" AND
  
  (  ( DateDiff ("n", Date({P_60403.BACKUP_START_DATE}),Date({P_60403.START_DATE}) ) ) +
     ( DateDiff ("n", Date({P_60403.END_DATE}),Date({P_60403.BACKUP_END_DATE}) ) ) = 0
  )
)

OR 
( {P_60403.LOG_STATUS} <> "O" AND 
  
    ( isNull({P_60403.BACKUP_START_DATE}) OR {P_60403.BACKUP_SYSTEM}="D" ) AND
  
   ( DateDiff ("n", Date({P_60403.END_DATE}), Date({P_60403.START_DATE})) ) = 0 )

then RecordNumber
else
a:=a+1;

Thanks,

Ekta
 
As the first line after the numbervar declaration, put something like this:

If PreviousIsNull({group field}) or ({group field} <> previous({group field}) then a := 0;

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top