Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Formula help Post Reply Post New Topic
Author Message
Paula J
Groupie
Groupie
Avatar

Joined: 22 Aug 2011
Location: United States
Online Status: Offline
Posts: 51
Quote Paula J Replybullet Topic: Formula help
    Posted: 16 Oct 2014 at 10:51am
I need each record to look for a previous record if the MRN matches and if it does then it needs to look at the service date and if the service date is within 90 days of the previous records discharge date then both of those records need to drop to the report.  The same needs to go on until the MRNs no longer match.
 
MRN      PNO  Service Dt     Discharge Dt
00111    222   01/29/2014  02/26/2014
00111    333   07/21/2014  07/21/2014
00111    444   07/23/2014  07/28/2014
 
So the crieteris is resulting these 3 records but only want the last two records to populate on the report because 7/21/014 service date on PNO 333 is not within 90 days of the 2/26/14 discharge date on PNO 222 but PNO 444 service date of 7/23/14 is within 90 days of the 7/21/14 discharge date on PNO 333.
 
 
Paula J
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 16 Oct 2014 at 11:27am
if it is only a display issue then you can use a fromual in the detail section as a conditonal suppression. maybe this?...
(onfirstrecord or
previous(table.MRN)<>table.MRN or
datediff('d',previous(table.discharteDt),table.serviceDt)<90)
and
(
next(table.MRN)<>table.MRN or
datediff('d',table.discharteDt,next(table.serviceDt))<90
)
IP IP Logged
Paula J
Groupie
Groupie
Avatar

Joined: 22 Aug 2011
Location: United States
Online Status: Offline
Posts: 51
Quote Paula J Replybullet Posted: 20 Oct 2014 at 1:50pm
Thanks you.
Paula J
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.