Skip to main content
Question

Formula: Color Coding and Dates

  • January 5, 2022
  • 0 replies
  • 67 views

Hello All! I am new to Quickbase and I am having trouble finding out how to code. I need to make a report that tracks all employees and how long they have worked at my company. I have the basic information, (I.e. Start date, employee, etc.) but I was wondering of there would be an easier way to automatically calculate how long the employee has worked from when they were hired until the present date. I also need to find out how to code those times in to different sections  (green= 0-1 years, blue= 1-5, etc) so I can graph that info. If anyone has any suggestions or can point me in the right direction to go that would be amazing! Thanks
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+22
  • Quickbase Alumni
  • January 5, 2022
Try this as a formula numeric field which should calculate the number of completed service years


var date HireDate = [Hire Date];

Year(Today())-Year($HireDate)
-
If(
Month(Today())<Month($HireDate)
or
(Month(Today())=Month($HireDate) and Day(Today())<Day($HireDate)),1,0)

------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------