On 23 May 2007 20:01:11 -0700,
(E-Mail Removed) wrote:
> Hello All:
>
> I am currently in the process of creating a database based on retiree
> information. I inputted all of my data into one main table and then
> created queries from this table. I then created a form based on each
> query. I needed Access to calculate the age of retirees so I followed
> the directions from Access which explain that a text box needs to be
> created in the form and then a formula is inserted in the
> ControlSource. This turned out fantastic and I got the results that I
> wanted. I realized that one of the reports that I need to create is
> based on people being below the age of 65. When I go to create a new
> query, in hopes of setting a filter for <65, age is not there b/c it
> is only in the form. Does anyone know of a way that the retiree age,
> once calculated, can be inserted in the query? I'm assuming that a
> macro would be needed. If more information is needed I would be glad
> to provide it. Hope to get some new ideas. Thanks again.
>
> -Anthony Morano
> Pension Fund Intern
Just calculate the age in the query, then use that column to filter
for ages under 65.
In a query, add a new column:
Age: DateDiff("yyyy", [DOB], Date()) - IIF(Format([DOB], "mmdd") >
Format(Date(), "mmdd"), 1, 0)
As criteria on this Age column, write:
<65
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail