Jump to content
Sign in to follow this  

finding most recent date and comparing it

Recommended Posts

I have 4 files: Donors, Donations, Orders, Letters

I have a date on each of these:

Donors - Creation date

Donations - Date of Donation (Auto enter, creation date)

Orders - Date of Order (Auto enter, creation date)

Letters - Date of Letter (Auto enter, creation date)

On the Donor file, I would like to create a field showing the date of the most recent donation, one showing the date of the most recent order, and one showing the date of the most recent letter. (I have all the relationships set up.)

Then I would like to compare the 4 dates and if all of them are 2 years or older, I want to be able to archive them.

Thanks so much for your help,


Share this post

Link to post
Share on other sites


In each related file, create 2 calculated fields.

c_markrecord = Case(recorddate<(Year(Status(CurrentDate)-2),0,1)

c_markallrelated = Case(Sum(SelfjoinOnDonor_ID::c_markrecord)<1,0,1)

....where the SelfjoinOnDonor_ID is a relationship from the Donor_ID to the Donor_ID within the same file.

Then, in your DonorFile.fp5, use this calculation ???

c_archiverecord = Case(c_markallrelated(FileDonation) + c_markallrelated(FileOrder)+c_markallrelated(FileLetter)=0, "Inactive", "Active").

So you now can archive all c_archiverecord's where the result is "Inactive" (couldhave also be a boolean result (1 or 0).

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.