Forum Discussion
ToddMolino
5 years agoQrew Cadet
Thanks so much Justin! I'll give it a go and see how it works. I REALLY appreciate the help! Stay tuned.....
Todd
------------------------------
Todd
------------------------------
Todd
------------------------------
Todd
------------------------------
ToddMolino
5 years agoQrew Cadet
Hi Justin,
I made just a few tweaks because it was giving me a false positive when their age was not going to be a multiple of 5 within the next 6 months. Here's what it looks like now. Thanks again!
var date birthday = [Birth Date];
// Find the date of their next birthday
var date birthdayThisYear = Date(Year(Today()), Month($birthday), Day($birthday));
var date birthdayNextYear = Date(Year(Today()) + 1, Month($birthday), Day($birthday));
var date nextBirthday = If(Today() > $birthdayThisYear, $birthdayNextYear, $birthdayThisYear);
// Find the age they will be on their next birthday
var number ageNext = [Current Age] + 1;
// Determine if their next birthday will be a divisible of 5
var number divisibleOfFive = Rem($AgeNext, 5);
// Determine if their Birthday is within the next 6 months
var bool inNextSixMonths = AdjustMonth($nextBirthday, -6) < Today();
// Final Evaluation: Determine if their next birthday will be in 6 months and if it is a divisible of 5
If(
$divisibleOfFive = 0 and $inNextSixMonths, true, false
)
------------------------------
Todd
------------------------------
I made just a few tweaks because it was giving me a false positive when their age was not going to be a multiple of 5 within the next 6 months. Here's what it looks like now. Thanks again!
var date birthday = [Birth Date];
// Find the date of their next birthday
var date birthdayThisYear = Date(Year(Today()), Month($birthday), Day($birthday));
var date birthdayNextYear = Date(Year(Today()) + 1, Month($birthday), Day($birthday));
var date nextBirthday = If(Today() > $birthdayThisYear, $birthdayNextYear, $birthdayThisYear);
// Find the age they will be on their next birthday
var number ageNext = [Current Age] + 1;
// Determine if their next birthday will be a divisible of 5
var number divisibleOfFive = Rem($AgeNext, 5);
// Determine if their Birthday is within the next 6 months
var bool inNextSixMonths = AdjustMonth($nextBirthday, -6) < Today();
// Final Evaluation: Determine if their next birthday will be in 6 months and if it is a divisible of 5
If(
$divisibleOfFive = 0 and $inNextSixMonths, true, false
)
------------------------------
Todd
------------------------------