Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Post Reply Post New Topic
Author Message
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Topic: Formula
     Posted: 02 Apr 2012 at 6:20am

Hello,

I need a formula that will show clients who do not have services for 90 days since the date of admission
 
I think i have the first part of the formula down
 
{episode.admission_dte} + 90
 
- Here are the field names I am using
{episode.admission_dte}
{episode.last_date_of_service}
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Apr 2012 at 6:51am
you might need to clarify this a little more.
my guess is that the episode.last_date_of_service is a field that is updated on each service entry so it is always the most recent date so it is not really indicating if a service was delivered prior to it.
Is that correct?
if the field is really the first date of service since admission you likely need to deal with NULL values too.
then it would be something like
(isnull({episode.last_date_of_service}) and
datediff('d',{episode.admission_dte},currentdate})>90)
or
(NOT(isnull({episode.last_date_of_service})) and
datediff('d',{episode.admission_dte},{episode.last_date_of_service})>90)
IP IP Logged
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Posted: 04 Apr 2012 at 7:42am
yes that is correct the episode.last_date_of_service is updated on each service entry.
 
worked! thank you!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Apr 2012 at 7:56am
My solution was if the field was not being updated. Since it is being updated you will get false positives as each subsequent service delivered will move the date futrher and further from the admission date.
You will likely have to start pulling in the service table to do this comparison correctly.
IP IP Logged
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