Access 2010 Web Report Age Calculation (1 Viewer)

Learn2010

Registered User.
Local time
Today, 08:20
Joined
Sep 15, 2010
Messages
415
I have an Access 2010 web database. I have a report with the field [Date Of Birth]. The record source for the report is a query, which has this field. What I would like to do is show the person's age as a field on the report.

I have tried putting calculations like the following in the query and on the form; Age=DateDiff("yyyy", [Bdate], Now())+ Int( Format(now(), "mmdd") < Format( [Bdate], "mmdd") )

These don't work. Does anyone have a solution?

Thank you.
 

Learn2010

Registered User.
Local time
Today, 08:20
Joined
Sep 15, 2010
Messages
415
I found an answer myself, somewhat, for future use. However, I still need a little help. I have an auto date in the report header named Auto_Date, and it is today's date, i.e., =Date(). I used the following formula:

=([Date Of Birth]-[Auto_Date])/-365

This works. The format of the field is "Fixed." It gives me two decimal places for the age. For example, the "Date Of Birth" of 9/18/1991 returns an age of 19.10; 12/20/1986 returns 23.85; and so on.

How do I get the formula to round the age to the nearest number. That is, 19.10 becomes 19; 23.85 becomes 23; and so on?
 

Learn2010

Registered User.
Local time
Today, 08:20
Joined
Sep 15, 2010
Messages
415
I got the answer from another forum. Set the Format to General Number and use the formula below:

=Int(([Auto_Date] - [Date Of Birth])/365)

Thanks.
 

jetpets

New member
Local time
Today, 05:20
Joined
Apr 18, 2012
Messages
3
Hello everyone

I created 2 forms:
Form 1 - Funding Amounts for different years of funding
Form 2 - Funding amounts for each activity>> for each project >> for each year

Note: Linked by File number. Not all projects receive funding for all activities

I would like Form 1 to indicate the total amount only from from Form 2.

Help?

thanks all
 

ernielippert

Registered User.
Local time
Today, 08:20
Joined
Sep 11, 2012
Messages
13
I got the answer from another forum. Set the Format to General Number and use the formula below:

=Int(([Auto_Date] - [Date Of Birth])/365)

Thanks.

The quoted equation works well but for accuracy 365 should be replaced by 365.2425, the average number of days per year.
Ernie Lippert
 

Users who are viewing this thread

Top Bottom