Adam Abrams Posted March 4, 2011 Posted March 4, 2011 Hi! I have a portal showing records of Contacts, where the filter criteria are: - The contact is specified as an Ongoing Pledge (OGP) donor; - The most recent donation from them was NOT received in the current month. This displays a list of all donors with outstanding monthly donations for THIS month. My filter criteria seemed to work fine and list the right people, however I saw that after I added any donation for someone in the list - even one that was not dated in the current month - their name gets removed from the portal. Yet the criteria for the filtering would seem to indicate that they most definitely should still be listed! And indeed I want them to still be in the list if the current month's donation has not yet been received. Here's my portal filtering calculation: ----------- (Contacts::Currently has OGP = "Yes" ) and Month(Contacts::LastDonationDate) ≠ Month(Get(CurrentDate)) and Year(Contacts::LastDonationDate) ≠ Year(Get(CurrentDate)) --------- I even set up a button just to throw up a custom dialog to confirm the various values used in the calculation: "Last donation date: " & Contacts::LastDonationDate & ". Month of that date is: " & Month(Contacts::LastDonationDate) & ". Year of it is: " & Year(Contacts::LastDonationDate) & ". CURRENT month is: " & Month(Get(CurrentDate)) & ". CURRENT year is: " & Year(Get(CurrentDate)) & "." The donor in question comes up with this info: Last donation date: 01/01/2011 Month of that date: 1 Year of that date: 2011 Current month: 3 Current year: 2011 So, by rights they should still be listed in the portal - but they're not. I imagine I'm missing something totally obvious... but what? Hope someone can see what I can't. Thanks!
comment Posted March 4, 2011 Posted March 4, 2011 Hint: Year(Contacts::LastDonationDate) ≠ Year(Get(CurrentDate)) Year of that date: 2011 Current year: 2011 BTW, donors with last donation in March of any year will not be shown either.
Adam Abrams Posted March 8, 2011 Author Posted March 8, 2011 Well then, I guess my question is, how do I phrase it to require that ALL the three conditions be true, not just one or two of them? Even if LastDonationDate is the same year, I want the donor to appear in the portal if it's not in the same month. I tried putting brackets between the last two conditions but it didn't make a difference in the portal listing...
comment Posted March 8, 2011 Posted March 8, 2011 how do I phrase it to require that ALL the three conditions be true Exactly the way you did. The problem here is one of logic, not syntax. The conditions you have set up simply do not match your stated requirements: - The contact is specified as an Ongoing Pledge (OGP) donor; - The most recent donation from them was NOT received in the current month. Try something like: Contacts::Currently has OGP = "Yes" and Let ( [ lastDon = Contacts::LastDonationDate ; today = Get (CurrentDate) ] ; lastDon - Day ( lastDon ) ≠ today - Day ( today ) )
Adam Abrams Posted March 8, 2011 Author Posted March 8, 2011 Wait a minute, I see what you mean - I'm forcing BOTH the month and day of the last donation to be different, which is not the criteria I actually want. I just don't want to show the donor if the month and day are both the same... I think I need to take my logic back to the drawing board for a bit!
comment Posted March 8, 2011 Posted March 8, 2011 I'm forcing BOTH the month and day of the last donation to be different You mean "year", not "day".
Adam Abrams Posted March 8, 2011 Author Posted March 8, 2011 Indeed, I just hadn't thought through my logic. This gets me the results I want! ( Year(Contacts::LastDonationDate) ≠ Year(Get(CurrentDate)) or ( Year(Contacts::LastDonationDate) = Year(Get(CurrentDate)) and Month(Contacts::LastDonationDate) ≠ Month(Get(CurrentDate)) ) ) and Contacts::Currently has OGP = "Yes" Thanks for making me think more clearly... :)
Recommended Posts
This topic is 5009 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now