来自生日场的当前年龄 [英] Current Age from birthday field

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

问题描述

我需要在我的表单上使用一个框来计算一个人的年龄,使用他们在同一表格上输入的生日字段(并存储在表格中)。当前年龄不需要存储在表格中。我只是希望它是可见的,这样我就不必在头脑中做任何事情。关于显示当前年龄所需表达的建议?


我使用Access 2003和Windows XP英文版。


谢谢,Tim

I need a box on my form that computes a person''s age using their birthday field entered on the same form (and stored in the table). The current age doesn''t need to be stored in a table. I just want it to be visible so that I don''t have to do the figuring in my head. Suggestions on the expression that would be needed to show the current age?

I am using Access 2003 with Windows XP in English.

Thanks, Tim

推荐答案

嘿,看看约会功能。如果您搜索帮助文件,应该会出现一些内容......可能是这样的:


lbl_age = datediff(''yyyy'',cboBirthDate,date)


了解更多信息/语法,请查看:

http://www.techonthenet.com/access/functions/date/datediff.php


希望这会有所帮助!

Hey, take a look at the datediff function. If you search the help file, something should come up... Maybe something like:

lbl_age = datediff(''yyyy'', cboBirthDate, date)

for more info/syntax, check out:
http://www.techonthenet.com/access/functions/date/datediff.php

Hope this helps!


我需要在我的表单上使用一个框来计算一个人的年龄,使用他们输入的生日字段相同的表格(并存储在表格中)。当前年龄不需要存储在表格中。我只是希望它是可见的,这样我就不必在头脑中做任何事情。关于显示当前年龄所需表达的建议?


我使用Access 2003和Windows XP英文版。


谢谢,Tim
I need a box on my form that computes a person''s age using their birthday field entered on the same form (and stored in the table). The current age doesn''t need to be stored in a table. I just want it to be visible so that I don''t have to do the figuring in my head. Suggestions on the expression that would be needed to show the current age?

I am using Access 2003 with Windows XP in English.

Thanks, Tim


而且我可以说最好查看Access论坛这篇文章主要讨论


:)
And also I can say that it''s better to check the Access forum this post is largely discussed

:)


以下适用于我(在Access 2002中) - 我的出生日期字段称为dob。该公式可防止错误。当dob字段尚未输入或无效时,字符串将出现在计算的年龄字段中。

The following works for me (in Access 2002) -- my Date-Of-Birth field is called "dob". This formula prevents "error" strings from appearing in the calculated age field when the dob field hasn''t yet been entered or is invalid.

展开 | 选择 | 换行 | 行号


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

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