Hey all, anyway have a formula they can share that...
# general
r
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
(({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
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
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
I would use FLOOR(MONTHS_BETWEEN(today,birthdate)/12),0) to get the age in whole years and condition off that.