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

How can I check if a record is the first record of a group? 1

Status
Not open for further replies.

matpj

Technical User
Mar 28, 2001
687
GB
I have tried using the onfirstrecord function, but that only looks at the first record of a report.
Is there a way to reset this after each group?
or is there another way.

I need to write a formula to check if its currently on the first record and then apply certain values etc..

Matt
London (UK)
 
Try:

if {table.groupfield} <> previous({table.groupfield}) then...

-LB

 
hi LB,
the problem with this is that sometimes in the group there may be instances where the previous field IS the same..


Matt
London (UK)
 
What do you mean by that? By definition, the first record of a group will have a different group value than the previous group. By {table.groupfield}, I mean the field you are grouping on--this is not necessarily the field you are using for calculations, but it will define that you are working with the first record of a group. Ordinarly, you would also add a reference to the first record, which I should have done above, as in:

if onfirstrecord or
{table.groupfield} <> previous({table.groupfield}) then...

-LB

 
oh sorry - my mistake!
thanks for your help!



Matt
London (UK)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top