?
Solved

Get running total of non duplicate records

Posted on 2004-11-18
5
Medium Priority
?
219 Views
Last Modified: 2012-05-05
I have to include a field in my report that will count the total number of records that are not duplicated in a group. The only problem with this code is that this count is off by one because of the logic. Why is this code off by one record and how can I fix it ?

whileprintingrecords;
onfirstrecord;
{ADMSTAT.PATSYS} <> previous({ADMSTAT.PATSYS}) AND {ADMSTAT.PATSYS} <> Next({ADMSTAT.PATSYS})
AND{ADMSTAT.ADM} = 'Y'
0
Comment
Question by:tupac1979
  • 3
5 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 12619499
Why did you include the ONFIRSTRECORD?

I think if you delete that you will be ok

mlmcc
0
 

Author Comment

by:tupac1979
ID: 12619522
I have tried it without it and still does not work ? Thanks
0
 

Author Comment

by:tupac1979
ID: 12619541
Also I have put that statement in there to try to start the records at the first one after each group do you have anymore suggestions
0
 
LVL 28

Accepted Solution

by:
bdreed35 earned 1000 total points
ID: 12619593
Try this instead of what you have:

(onfirstrecord
or
(onlastrecord and {ADMSTAT.PATSYS} <> previous({ADMSTAT.PATSYS}))
or
({ADMSTAT.PATSYS} <> previous({ADMSTAT.PATSYS}) AND {ADMSTAT.PATSYS} <> Next({ADMSTAT.PATSYS})))
and
{ADMSTAT.ADM} = 'Y'


you don't need the whileprintingrecords either.
0
 

Author Comment

by:tupac1979
ID: 12619651
Good job thanks
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question