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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|