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!

A formula for first and last records.

Status
Not open for further replies.
Apr 11, 2002
193
IN
Hi,

I have a report which i have grouped by userid. So i get some records for that group. I have taken a count of number of records in a group. Now i want to display something when i am on the first record and the last record. But sometimes it happens that the count is zero. So in dat case i want to display a text on the first null record like "Text"+chr(13)+"text".

I hope my post is clear.

I am using CR8 and Sybase9.

Thanks
Manish
 
I'm not clear about one thing here.
How are you able to get a group created where you have no records?
 
If you are counting all members of a group, you can use a Summary Count to find the total number of details in that group. On Crystal 8.5, that's right-click, [Insert] and [Summary], or else the insert icon that's next to ab.

If your count is based on a test of group members, it's harder. You could use Next and Previous, as with
Code:
If {your.field} = next({your.field})
But that might not be useful in your case. Better, maybe, to eliminate everything you don't want to count on the main report, and insert a subreport for groups that you'd count as zero.

Madawc Williams
East Anglia, Great Britain
 
Hi Lupins,

Thanks for the reply. What i mean by no records is that i have a user but the user didnt do any activity so there is no records related to the user. I mean something like this.

User1
Test 10
10
Test1 80
----------------------------------
User2
Test N/A
Test1
----------------------------------

In these 2 records i have some activities done by user1 and no activities done by user2. Test and Test1 are the remarks that i have to pass using the formula. My problem is i have to put this formula in the detail section as the client doesnt want one line to be waisted. If i have to put it in the detail section and so i have to use a single formula. There can be n number of records for a user or there cant be any. I have to pass a remark according to the first value and the last value and put these remarks on the first record and the last record.

If this is still not clear then please let me know.

Thanks
Manish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top