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!

How to verify that I am on the first record of a group 2

Status
Not open for further replies.

skiabox

Technical User
Joined
Aug 27, 2002
Messages
125
Location
GR
Is there any way I can enter in a formula a condition that it will be true when I am in the first record of a group?(It is placed in Group Footer).
I have a formula that display a calculation but it repeats itself across all group records.
I want to have the calculation displayed only in the first record of the group.
Thank you.
 
if onfirstrecord or
{table.groupfield} <> previous({table.groupfield}) then//etc.

-LB
 
It doesn't work in footer of the group.
In header of the group it prints a string that I put after then in the formula but in all group records of the report.
Thnx for answering.
 
I take it back.It worked!Can it work in the footer?If it doesn't I will move all the other fields of the footer in the header.
 
Any field reference in the footer will return the last record in the group, so the previous() function will refer to the next-to-last record in the group.

So in the footer it will not work unless the group has only 1 record.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Now that I moved my formulas to the group header they procude zeros instead of values.Any ideas how to solve this one?
Thnx for your help.
 
Can the Group Header appear in the same line as the group footer in the report?This could solve the problem.
 
No, of course not. Please show the content of your formula so we can see what you are trying to do. I thought you meant you wanted something on the first detail record within the group. Please clarify--do you mean you only want the formula to appear in the first group instance? If so, then use this:

if groupnumber = 1 then //etc.

-LB
 
lbass your formula worked fine.
I have two groupings in my report and it works in any of the two group headers.
It display a string every time the outer group changes which is exactly what I wanted it to do.
The problem is that my formulas are placed in the footer of the inner group.
I have placed your formula in the inner group(header).
Can I have both your formula and mines in the same line?
Thank you!
 
I have no idea what you mean. Please try again, and show the content of the formulas and explain the results you expect to see.

-LB
 
can't you see the video?
 
Not planning on doing that--maybe someone else will.

-LB
 
I can post the formulas if you want.I just thought that the video would visualize the problem and could make it easier to conseive.Just tell me if you want me to post the formulas.Thnx!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top