PC Review


Reply
Thread Tools Rate Thread

age calculation

 
 
Learner's Permit DB
Guest
Posts: n/a
 
      23rd Oct 2008
I'm a bit new to programming in Access DB. I would like to calculate the age
of a person within a table. Is this possible? How would I go about doing
this?
 
Reply With Quote
 
 
 
 
fredg
Guest
Posts: n/a
 
      23rd Oct 2008
On Thu, 23 Oct 2008 11:12:01 -0700, Learner's Permit DB wrote:

> I'm a bit new to programming in Access DB. I would like to calculate the age
> of a person within a table. Is this possible? How would I go about doing
> this?


"Within a table"?
You mean do the computation in a table? No, you can't.
However ....
In a query:
Age: DateDiff("yyyy",[DOB],Date())-Iif(Format([DOB],
"mmdd")>Format(Date(),"mmdd"),1,0)

Directly as the control source of an unbound control in a form or
report:
=DateDiff("yyyy",[DOB],Date())-IIf(Format([DOB],
"mmdd")>Format(Date(),"mmdd"),1,0)

Where [DOB] is the birthdate field.

This Age computation should NOT be stored in any table. Just compute
it and display it on a form or report, as needed.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use a rounded calculation result in another calculation? =?Utf-8?B?dm5zcm9kMjAwMA==?= Microsoft Excel Worksheet Functions 1 26th Jan 2005 10:11 PM
How do I use a rounded calculation result in another calculation? =?Utf-8?B?dm5zcm9kMjAwMA==?= Microsoft Excel Worksheet Functions 1 26th Jan 2005 09:36 PM
Concatenating a Calculation with Text causes the Calculation to be incorrect?? Nelson Microsoft Excel Worksheet Functions 4 1st Apr 2004 06:51 PM
Calculation based on another calculation T Smith Microsoft Access Forms 3 8th Jan 2004 12:04 AM
range.calculation with UDF not working when calculation is set to automatic Brian Murphy Microsoft Excel Programming 5 14th Oct 2003 07:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:48 AM.