kon
kon

Reputation: 13

Best way to store age in database, no DOB

Ok, so I need to store ages in a database. There are no DOBs because the data set is animals with an age estimate. The ages can be days, weeks, months or years. What is the best way to store this? We have 1 year, or .5 year (6 months), or 9/52=.17307... (for 9 weeks), and that is how it is stored now. So for anything under 1 year, the entry person needs to calculate the age in this way. Trying to figure out a better way than this mess. Suggestions?

Thanks!

Upvotes: 1

Views: 1521

Answers (1)

Gratzy
Gratzy

Reputation: 9389

Why not store it in the most granular form, say days, and then you can convert it to weeks, months, years etc.

Upvotes: 4

Related Questions