Flag a Field

C

Cindy

I have a query that pulls everyone that has a certain type of insurance. I
also have a query that pulls everyone who is age 35 and above. Is there a
way to change my everyone query to flag those people who are age 35 and
above? I still want to see everyone but I want those that are 35 or older to
have an asterik or a "yes" or something to identify them in the large list of
people. I tried adding a column to my "everyone" query that said IIf
([DOB]=Between #1/1/1900# and #12/31/1970#, "yes") but it doesn't like that
way I wrote that one. It just wants to pull only those people that fall
within that parameter. Thanks.
 
K

KARL DEWEY

Open your 'everyone' query in design view, scroll to the right to a blank in
the Field row, type this there --
Over_35: IIf([DOB] Between #1/1/1900# and #12/31/1970#, "Yes","")
 
L

Lord Kelvan

to make it dynamic and to work you need to do

above 35: IIf([DOB] Between DateAdd("yyyy",-35,Date()) And
Date(),null,"yes")

your problem was the = in the ([DOB]=Between

that query will dynamically calculate values between now and 35 years
ago which my query returns 1973 this means you wont need to change the
query every year because it will automatically update its self ie if
someone has a birthday and they become 35 then they will have a yes
displayed against them

hope this helps

regards
kelvan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top