Forum Discussion
- QuickBaseCoachDQrew Captainno problem
Date(Year(Today()),Month(Today()),Day([$MyDate]))
so that will always have the year of the current year and the month of the current month, but the day number will float according to the date in your date field. - LoriLori1Qrew MemberPerftect, thank you!
- RoxanneZieglerQrew CadetWhat is the $Mydate field suppose to be? I am working on something similar - I want a today's date or current date - I am trying to take a start date of employment and to count how many years that person has worked from "today's date - so it will change based on Today's date
thanks - QuickBaseCoachDQrew CaptainHere is an formula for AGE in full integer years. So that would be completed full service years in your use case.
var date DOB = [DOB];
Year(Today())-Year($DOB)
-
If(
Month(Today())<Month($DOB)
or
(Month(Today())=Month($DOB) and Day(Today())<Day($DOB)),1,0) - RoxanneZieglerQrew Cadetwhat is DOB?
- RoxanneZieglerQrew Cadetwhat is DOB?
- QuickBaseCoachDQrew CaptainIn my example it was a date field for the Date Of Birth.
- RoxanneZieglerQrew CadetSo I would just use my start date instead of DOB? so
var date DOB = [DOB];
would become
var date Startdate = [startdate] - QuickBaseCoachDQrew Captainyes,
I suppose a better generic format would be this
var date MyDate = [Start Date];
Year(Today())-Year($MyDate)
-
If(
Month(Today())<Month($MyDate)
or
(Month(Today())=Month($MyDate) and Day(Today())<Day($MyDate)),1,0) - RoxanneZieglerQrew Cadetcomes up with a bunch of errors when I add it to the formula. $mydate seems to be a big problem
A variable declaration must end with a semi-colon.
var date MyDate = [Start of Employment] Date];
Year(Today())-Year($MyDate DOB)
-
If(
Month(Today())<Month($MyDate DOB)
or
(Month(Today())=Month($MyDate) and Day(Today())<Day($MyDate)),1,0)