Calculating in table field

  • Thread starter Thread starter :\(
  • Start date Start date
?

:\(

Hi.
I've created a field in a form that calculates the age from the birthdate of
the previous field.
But I would like it to figure in the table. All the help info only tells you
how to do it in a form.
Can someone please tell me how to be able to do either have the table see
the age from the form or how to put the format in the table field.
Thanks
J.
 
As answered alll the time in these newsgroups (did you try searching?) you
don't store calculated results in a table. It is redundnat and what happens
if one of the values change?

Search and read previous posts for more details.

Rick B
 
Don't store age in a table!!

Date of Birth is a constant
Age is variable

Use tables to store data (date of birth)
Use forms to 'see data' and enter data.

Ed Warren
 
ok ok Gotcha. Thanks.
I only wanted it there coz I am trying to set up a mail merge into word for
a letter that will give the age of the person at the time of writing the
letter.
As far as I get it, you can only mail merge from tables and not forms.
But that's another story. I promise to search more thoroughly before I ask
about that one!!
Thanks again.
 
I would guess you can mail merge from a query.



:( said:
ok ok Gotcha. Thanks.
I only wanted it there coz I am trying to set up a mail merge into word for
a letter that will give the age of the person at the time of writing the
letter.
As far as I get it, you can only mail merge from tables and not forms.
But that's another story. I promise to search more thoroughly before I ask
about that one!!
Thanks again.
 
AaHaa! (the my lightbulb glimmers)

What you want to do is base your mail-merge on a query. Use date of birth
to calcuate the age in the query (based on date of birth and sendingdate)
and you have just what you want. You will want to function in a module

CalcAge(passedDateOfBirth as Date/time, passedDateOfMailing as date) as
integer

Then in the query you will enter in one of the columns:

Age:CalcAge([dateOfBirth],[DateOfMailing])

Ed Warren
-
 
Personally, I would not make it that complex. I would just add a new column
to my query with...


Age:
DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))







Ed Warren said:
AaHaa! (the my lightbulb glimmers)

What you want to do is base your mail-merge on a query. Use date of birth
to calcuate the age in the query (based on date of birth and sendingdate)
and you have just what you want. You will want to function in a module

CalcAge(passedDateOfBirth as Date/time, passedDateOfMailing as date) as
integer

Then in the query you will enter in one of the columns:

Age:CalcAge([dateOfBirth],[DateOfMailing])

Ed Warren
-
:( said:
ok ok Gotcha. Thanks.
I only wanted it there coz I am trying to set up a mail merge into word
for a letter that will give the age of the person at the time of writing
the letter.
As far as I get it, you can only mail merge from tables and not forms.
But that's another story. I promise to search more thoroughly before I ask
about that one!!
Thanks again.
 
Ok I'll experiment.
Thanks for all your help



Rick B said:
Personally, I would not make it that complex. I would just add a new
column
to my query with...


Age:
DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(
),"mmdd"))







Ed Warren said:
AaHaa! (the my lightbulb glimmers)

What you want to do is base your mail-merge on a query. Use date of
birth
to calcuate the age in the query (based on date of birth and sendingdate)
and you have just what you want. You will want to function in a module

CalcAge(passedDateOfBirth as Date/time, passedDateOfMailing as date) as
integer

Then in the query you will enter in one of the columns:

Age:CalcAge([dateOfBirth],[DateOfMailing])

Ed Warren
-
:( said:
ok ok Gotcha. Thanks.
I only wanted it there coz I am trying to set up a mail merge into word
for a letter that will give the age of the person at the time of
writing
the letter.
As far as I get it, you can only mail merge from tables and not forms.
But that's another story. I promise to search more thoroughly before I ask
about that one!!
Thanks again.


Don't store age in a table!!

Date of Birth is a constant
Age is variable

Use tables to store data (date of birth)
Use forms to 'see data' and enter data.

Ed Warren


Hi.
I've created a field in a form that calculates the age from the
birthdate of the previous field.
But I would like it to figure in the table. All the help info only tells
you how to do it in a form.
Can someone please tell me how to be able to do either have the table
see the age from the form or how to put the format in the table
field.
Thanks
J.
 
Back
Top