Hello! I recently got into canning (and general food preservation). I have created a database which helps me manage my inventory levels of products I have canned (Example: Jars of: Carrots, Green Beans, Jams, Jelly, etc). In my table where I record batch information - I am recorded the date I created that batch of product. I’d like to have a column (called Age) that returns the age of the product (batch) in #.## format. For example: If I created a batch of product today, it’s age should read: “0.00” meaning its 0 years and 0 months old. If I created a batch 1 year ago, I’d like it to say “1.00” because it’s a year old. If I created a batch ‘days short of it being 2 yrs old’, I’d like it to say “1.11” because it’s 1 year old and 11 months. Any help would be greately appreciated.
Solved
Formula To Return Age of Product in #.## format
Best answer by Justin_Barrett
Not a problem at all, I really appreciate the help! It works beautifully! Thank you so much!
And if you want two digits after the period, here’s the update for that:
DATETIME_DIFF(NOW(), Date, "years") & "." & REPT("0", 2-LEN("" & MOD(DATETIME_DIFF(NOW(), Date, "months"), 12))) & MOD(DATETIME_DIFF(NOW(), Date, "months"), 12)
Login to the community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
