Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Filtering Date of Birth Field

Status
Not open for further replies.

hollyann

Technical User
Apr 12, 2000
15
US
We are currenly using Access 95 at our office (I know!) and we could use some assistance on a query we are trying to create.  We need to create a query from our date of birth field that will allow us to view only our clients 65 or older.  We have made several attempts using the expression builder and either get no data or all the data (using the greater than or equal to etc. but we just cannot seem to get it right.  
 
dim target as date<br>target = dateadd(&quot;y&quot;, -65, now())<br><b>----------------------------------------------</b><br>target now contains the value of now minus 65 years.<br>Therefore,<br><br>SELECT * FROM TABLE WHERE
.[birthdate] &lt;= dateadd(&quot;y&quot;, -65, now())<br><br>Yields the results you're after.<br><br> <p>Amiel<br><a href=mailto:amielzz@netscape.net>amielzz@netscape.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top