Hey all, anyway have a formula they can share that checks a date field and compares it to {today} to see if someone is over 21? Or any sort of other age gating / age checking capabilities they can share? Thanks all
r
raghav
04/11/2023, 8:11 PM
(({today}-{birthdate})/365.25)>21
A more complex and accurate approach you can take is.
Today's birthday year > 21 then true
Else
Today's year - birthday's year = 21
then Today month > birthday's month then true else if today month = birthday's month then Today's date > birthday's date then true
Else false
There is also the formula age in years in the drop down field which you can use.
p
Patrick Olson
04/11/2023, 8:16 PM
I would use this in a Formula(text) column in a saved search
CASE
WHEN {birthdate} <= ADD_MONTHS({today}, -21*12)
THEN 'Yes'
ELSE 'No' END
m
Michael McNamara
04/11/2023, 8:59 PM
This is not setup specifically, but the criteria logic is still similar:
ADD_MONTHS({birthdate},(12*(EXTRACT(YEAR FROM {today})-EXTRACT(YEAR FROM {birthdate}))))
t
Tristan Day
04/11/2023, 9:44 PM
I would use FLOOR(MONTHS_BETWEEN(today,birthdate)/12),0) to get the age in whole years and condition off that.