Forum Discussion
- rbuschmeyerQrew TraineeI actually have this very thing in an app I built for another entity:
First, I built a report that displays "Birthdays (Next Month)", then I created a Quickbase Notification that sends the report to a specified user on the 15th day of each month.
The report is built off of the Birthday field (Formula Date) and an "Age (Now)" field (formula-numeric). "Birthdate" field below is a standard Date field.
Birthday Formula:AdjustYear([Birthdate], [Age (Now)]+1)
Age Now Formula://AGE and decimal months
// replace the [DOB] field with your date of birth field
var date DOB = [Birthdate];
var number Years =
Year(Today())-Year($DOB)
-
If(
Month(Today())<Month($DOB)
or
(Month(Today())=Month($DOB) and Day(Today())<Day($DOB)),1,0);
var number MonthsDifference = Month(Today()) - Month($DOB) ;
var number Months = If($MonthsDifference >= 0, $MonthsDifference, 12 + $MonthsDifference);
Round($Years + $Months/12,0.1)
Hope this helps.
------------------------------
Ryan Buschmeyer
------------------------------- KeithHendrickQrew MemberThanks, Ryan.
------------------------------
Keith Hendrick
------------------------------
- MarkShnier__YouQrew LegendHere is an example of a formula Date Field which will calculate an employees Next anniversary of their hire date. You could just adapt it for your purposes
var date HireDate=[Hire Date];
var date Datetest = Date(Year(Today()),Month($HireDate),Day($HireDate));
IF($DateTest >= Today(), $DateTest, AdjustYear($DateTest,1)
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------- AUshYCQrew Trainee
Hi All,
Thanks for explaining how to do this! I've attempted to copy the formula you've shared to get my birthdays in a month/day format. I keep getting a syntax error reporting a missing parentheses bracket. Here's what I have for my formula. Would you happen to have any idea what I'm doing incorrectly?
var date Birthday=[Date of Birth];
var date Datetest = Date(Year(Today()),Month([Date of Birth]),Day([Date of Birth])
IF($DateTest >= Today(), $DateTest, AdjustYear($DateTest,1))Thanks in advance! :)
-Abby
- MarkShnier__YouQrew Legend
try this fix. needs an extra closing ) at the end of the 2nd line.
var date Birthday=[Date of Birth];
var date Datetest = Date(Year(Today()),Month([Date of Birth]),Day([Date of Birth]))
IF($DateTest >= Today(), $DateTest, AdjustYear($DateTest,1))
- KeithHendrickQrew MemberWorked perfectly. Thanks!
------------------------------
Keith Hendrick
------------------------------