PC Review


Reply
Thread Tools Rate Thread

computing age

 
 
barbara
Guest
Posts: n/a
 
      11th Aug 2003
been using access2000 data base successfully on
access2002 with XP. now must determine client's ages.
first i put in just the current year and birth year and
put in a formula to do simple subtraction, which is fine
in the form screen. then i put in a field with month, so
i can tell by each month, each client's age that month
(it is necessary to know when a retired client is a
certain age). when i run the query a month at a time,
the ages all are incorrect, yet they are correct in the
form view. this is driving me crazy. i designed the
data base 3 years ago and its served for all needs until
now.
Ideally, i would like to have "current date" field
automatically entered, and have it subtract birth date
(mmddyyyy), to determine age if that's at all possible.
any help will be greatly appreciated.

 
Reply With Quote
 
 
 
 
Fredg
Guest
Posts: n/a
 
      11th Aug 2003
Barbara,
Since you haven't posted the exact expression you are attempting to use,
here is one which will accurately return a person's correct age.

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

In a query:
AgeateDiff("yyyy",[DOB],Date())-IIf(Format([DOB],"mmdd")>Format(Date(),"mm
dd"),1,0)

You could search for all records where the month of the date of birth was
the current month by setting the query criteria to:
Where Month([DOB]) = Month(Date())

Change [DOB] to the name of the actual birth date field is you are using.

--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.


"barbara" <(E-Mail Removed)> wrote in message
news:048701c36040$064ae190$(E-Mail Removed)...
> been using access2000 data base successfully on
> access2002 with XP. now must determine client's ages.
> first i put in just the current year and birth year and
> put in a formula to do simple subtraction, which is fine
> in the form screen. then i put in a field with month, so
> i can tell by each month, each client's age that month
> (it is necessary to know when a retired client is a
> certain age). when i run the query a month at a time,
> the ages all are incorrect, yet they are correct in the
> form view. this is driving me crazy. i designed the
> data base 3 years ago and its served for all needs until
> now.
> Ideally, i would like to have "current date" field
> automatically entered, and have it subtract birth date
> (mmddyyyy), to determine age if that's at all possible.
> any help will be greatly appreciated.
>



 
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
Computing the item age AG Microsoft Excel Worksheet Functions 2 28th May 2009 03:11 AM
64 bit computing =?Utf-8?B?TmFkYXY=?= Microsoft VC .NET 6 25th Apr 2005 02:37 PM
computing time Stéf Microsoft Excel New Users 3 1st Aug 2004 09:18 PM
Alt F4 Computing Alt F4 AMD 64 Bit 0 4th May 2004 05:08 PM
Alt F4 Computing Alt F4 Computer Hardware 0 4th May 2004 05:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:20 AM.