PC Review


Reply
 
 
=?Utf-8?B?ZGVl?=
Guest
Posts: n/a
 
      23rd Jul 2007
Hi,

I have researched and it appears that I can calculate the age of an
individual based on the DOB within a form or report.

From what I gather, it is impossible to create an actual field that contains
the age, though. I would need this, as will be transferring the Access data
to another software package in order to perform statistical analysis.

Impossible?

--
Thanks!

Dee
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      23rd Jul 2007
You probably don't need an Age field.

Create a query that contains all of the fields currently in your table.

Add a computed field to that query that computes the Age based on the DOB
field:

Age: DateDiff("yyyy", [DOB], Date()) - IIf(Format(Date(), "mmdd") <
Format([DOB], "mmdd"), 1, 0)

Use the query wherever you would otherwise have used the table.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"dee" <(E-Mail Removed)> wrote in message
news:AFFA5DE6-67EE-40CE-AF0B-(E-Mail Removed)...
> Hi,
>
> I have researched and it appears that I can calculate the age of an
> individual based on the DOB within a form or report.
>
> From what I gather, it is impossible to create an actual field that
> contains
> the age, though. I would need this, as will be transferring the Access
> data
> to another software package in order to perform statistical analysis.
>
> Impossible?
>
> --
> Thanks!
>
> Dee



 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      23rd Jul 2007
It's not impossible, Dee. It's just unnecessary. With just a few hundred
people in the database, you would have to run a routine *every* day to try
to keep all the ages up to date. Who needs that when there's a dead-easy,
maintenance-free solution.

Just create a query, and show the age as a calculated field in the query.
You can then use the query anywhere you could use the table, including
exporting to other software.

Here's how:
http://allenbrowne.com/func-08.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"dee" <(E-Mail Removed)> wrote in message
news:AFFA5DE6-67EE-40CE-AF0B-(E-Mail Removed)...
>
> I have researched and it appears that I can calculate the age of an
> individual based on the DOB within a form or report.
>
> From what I gather, it is impossible to create an actual field that
> contains
> the age, though. I would need this, as will be transferring the Access
> data
> to another software package in order to perform statistical analysis.
>
> Impossible?
>
> --
> Thanks!
>
> Dee


 
Reply With Quote
 
=?Utf-8?B?U3ByaW5rcw==?=
Guest
Posts: n/a
 
      23rd Jul 2007
Dee,

An Age field stored in a table would potentially need to be updated every
day to ensure that each one is current. Simply use a calculated field in a
query to calculate the age when you need it, and export the query to your
statistical analysis program:

In the Field row of the query, enter:

Age: YourCalculation([DOB])

Hope that helps.
Sprinks

"dee" wrote:

> Hi,
>
> I have researched and it appears that I can calculate the age of an
> individual based on the DOB within a form or report.
>
> From what I gather, it is impossible to create an actual field that contains
> the age, though. I would need this, as will be transferring the Access data
> to another software package in order to perform statistical analysis.
>
> Impossible?
>
> --
> Thanks!
>
> Dee

 
Reply With Quote
 
=?Utf-8?B?ZGVl?=
Guest
Posts: n/a
 
      23rd Jul 2007
Thanks to all of you for your help. I am starting a new database from
scratch, so will probably be posting LOTS of questions!
--
Thanks!

Dee


"Allen Browne" wrote:

> It's not impossible, Dee. It's just unnecessary. With just a few hundred
> people in the database, you would have to run a routine *every* day to try
> to keep all the ages up to date. Who needs that when there's a dead-easy,
> maintenance-free solution.
>
> Just create a query, and show the age as a calculated field in the query.
> You can then use the query anywhere you could use the table, including
> exporting to other software.
>
> Here's how:
> http://allenbrowne.com/func-08.html
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "dee" <(E-Mail Removed)> wrote in message
> news:AFFA5DE6-67EE-40CE-AF0B-(E-Mail Removed)...
> >
> > I have researched and it appears that I can calculate the age of an
> > individual based on the DOB within a form or report.
> >
> > From what I gather, it is impossible to create an actual field that
> > contains
> > the age, though. I would need this, as will be transferring the Access
> > data
> > to another software package in order to perform statistical analysis.
> >
> > Impossible?
> >
> > --
> > Thanks!
> >
> > Dee

>
>

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      23rd Jul 2007
"Sprinks" <(E-Mail Removed)> wrote in message
news:5F745315-3CF7-4DA4-A186-(E-Mail Removed)...
> Dee,
>
> An Age field stored in a table would potentially need to be updated every
> day to ensure that each one is current.


Potentially? Does that mean you've discovered how to stop aging? <g>

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      23rd Jul 2007
On Mon, 23 Jul 2007 07:04:02 -0700, dee <(E-Mail Removed)> wrote:

>From what I gather, it is impossible to create an actual field that contains
>the age, though. I would need this, as will be transferring the Access data
>to another software package in order to perform statistical analysis.


Just to add to the other comments - if you assume that you must have data
stored in a table to export it to another software package, that assumption is
WRONG. You can export from a Query just as easily as from a Table.

John W. Vinson [MVP]
 
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
Field Property (OldValue) not available in Field Object defined withDim As Field? insomniux Microsoft Access VBA Modules 2 11th Apr 2009 02:19 PM
In a sub-form : when entering a field, verify if another field is true, if so show a MsgBox + set focus on another field Céline Brien Microsoft Access Forms 4 14th May 2008 03:30 PM
I want to combine a date field and a time field into 1 field. Bob Quintal Microsoft Access 4 28th Sep 2007 06:29 PM
On a report, print field A or field B based on value in field C =?Utf-8?B?R2FyeSBGcmFj?= Microsoft Access Reports 4 1st Aug 2007 08:10 PM
2 Related field or Auto fill up 2nd field after 1st field entered =?Utf-8?B?S2FvbGk=?= Microsoft Access Getting Started 1 17th Sep 2006 11:40 AM


Features
 

Advertising
 

Newsgroups
 


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