Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / October 2006

Tip: Looking for answers? Try searching our database.

Add and check if customer age of 70 yrs?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TKM - 31 Oct 2006 22:56 GMT
I need to have a query that will check against another field (RMD) in my
query to see if the customer is 70 1/2 years old and to include any leap
year. How is this done?

I am trying to see if a customer can collect on his insurance based off a
field in my query. I need my query to check and make sure the cusotmer has
set up a "RMD" (also the field name) set up and if TRUE and he is 70 1/2
years old by the end of the current year.

Thanks in advance
Brendan Reynolds - 31 Oct 2006 23:08 GMT
Something like this should do it ...

SELECT tblTest.*
FROM tblTest
WHERE (((tblTest.DOB)<DateAdd("m",-906,DateSerial(Year(Date()),12,31))));

The DateSerial function gets the last day of the current year, and the
DateAdd function subtracts 906 months ((75 * 12) + 6) from that.

Signature

Brendan Reynolds
Access MVP

>I need to have a query that will check against another field (RMD) in my
> query to see if the customer is 70 1/2 years old and to include any leap
[quoted text clipped - 6 lines]
>
> Thanks in advance
John Vinson - 01 Nov 2006 00:55 GMT
>I need to have a query that will check against another field (RMD) in my
>query to see if the customer is 70 1/2 years old and to include any leap
[quoted text clipped - 6 lines]
>
>Thanks in advance

What is RMD? What's its datatype, and how can it be "checked"? Do you
have a date of birth field? If so you can use a calculated field to
determine the person's age in months as of the end of the current
year:

DateDiff("m", [DateOfBirth], DateSerial(Year(Date()) + 1, 1, 0))

Use a criterion of >= 426 to select people who will be over 70 years,
6 months as of the end of the current year.

                 John W. Vinson[MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.