A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Age Field



 
 
Thread Tools Display Modes
  #1  
Old July 23rd, 2007, 03:04 PM posted to microsoft.public.access
Dee
external usenet poster
 
Posts: 644
Default Age Field

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
  #2  
Old July 23rd, 2007, 03:21 PM posted to microsoft.public.access
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Age Field

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" wrote in message
...
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



  #3  
Old July 23rd, 2007, 03:23 PM posted to microsoft.public.access
Allen Browne
external usenet poster
 
Posts: 11,706
Default Age Field

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" wrote in message
...

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


  #4  
Old July 23rd, 2007, 03:26 PM posted to microsoft.public.access
Sprinks
external usenet poster
 
Posts: 531
Default Age Field

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

  #5  
Old July 23rd, 2007, 03:38 PM posted to microsoft.public.access
Dee
external usenet poster
 
Posts: 644
Default Age Field

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" wrote in message
...

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



  #6  
Old July 23rd, 2007, 04:18 PM posted to microsoft.public.access
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Age Field

"Sprinks" wrote in message
...
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!)



  #7  
Old July 23rd, 2007, 06:57 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Age Field

On Mon, 23 Jul 2007 07:04:02 -0700, dee 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]
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.