计算当前年龄的公式 [英] Formulas for calculating current age

查看:124
本文介绍了计算当前年龄的公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个没有经验的访问用户,需要知道如何创建一个公式,使年龄自动逐年变化,而无需手动操作。我不知道语言,使用的源代码输入或错误代码,但我只想用一个简单的公式来为我们的教会成员创建一个简洁的数据库。

I am an inexperienced access user needing to know how to create a formula for making an age automatically change year by year without manually having to do it. I do not know the language, source codes input used or error codes, but I would just like a simple formula to create a concise database for our church membership.

推荐答案

你好。我使用一个名为AgeAtEnrolment的自定义Visual Basic for Applications函数来计算学生在我工作的大学注册之日的年龄。在VBA和SQL中使用它是这样的:
Hi. I use a custom Visual Basic for Applications function called AgeAtEnrolment to compute the age of students at the date of their enrolment in the college in which I work. It is used like this, in VBA and in SQL:
展开 | 选择 | Wrap | 行号


好吧,即使是一个简单的公式,你也可以我将不得不使用一些代码来执行它。对于新手而言,这可能比斯图尔特的优秀功能更简单一些。简单的公式是

Well, even with a simple formula, you''re going to have to use some code to execute it.This is, perhaps, a little simpler code for for a newbie than Stewart''s excellent function. The simple formula is

展开 | 选择 | Wrap | 行号


这个功能,令人惊叹的Allen Browne的赞美,并通过一些修改我自己,将精确计算年龄为整数。它将根据出生日期和可选截止日期计算此年龄。使用DateDiff()函数存在的差异中的代码因素,并使用我的DOB作为示例,具有各种输入和后续输出。不要让大量的代码吓倒你,其中很多都是评论。如有任何问题,请随时询问:
This Function, compliments of the amazing Allen Browne, with a few modifications by myself, will precisely calculate Age as a Whole Number. It will calculate this Age based on a Birth Date and an Optional As Of Date. The code factors in discrepancies that exist with the DateDiff() Function and uses my DOB as an example, with various Inputs and subsequent Outputs. Don''t let the amount of code intimidate you, a lot of it is Comments. Any questions, please feel free to ask:
展开 | 选择 | Wrap | 行号


这篇关于计算当前年龄的公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆