Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula for compliance 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 for compliance
     Posted: 08 Dec 2015 at 1:31pm
Hello I need some help in writing a formula to evaluate if a record is compliant.

Fields:
admission.admission_date
otherdata.date_of_entry

Parameter is on admission_date ?StartDate and ?End_Date
(Ideally this would be for a month period, lets say November)

I need to display "Compliant" if the otherdata.date_of_entry is within the next months first 5 days (December 5th). Otherwise it will be "Not Compliant".

I need this evaluation to happen for any month the report is ran.

Thank you in advance
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Dec 2015 at 2:55am
select statement is something like
{admission.admission_date} in {?StartDate} to {?EndDate}
or you can force them to choose a month or one date that defines the month to avoid a user entering an invalid date range

For your "Compliance" Formula you were unclear if it has to be in that first 5 days of the next month or just before the end of that fifth day. I will assume it has to be on or after the original date and before the fifth day
It will be something like

if {otherdata.date_of_entry} in {admission.admission_date } to dateserial(year({admission.admission_date }),month({admission.admission_date }+1),5) then 'Compliant' else 'Not Compliant'

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