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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

determine age within a specific range?

Status
Not open for further replies.

ad2

Technical User
Dec 31, 2002
186
US
Hi,

I have a ScreenDate (date of subject interview) and subject's DOB (date of birth)

I need a code that will determine if the subject's 65th birthday is 6 weeks away from the ScreenDate.

I can determine the overall age by this: Age=(Screendt-DOB)
but is there a way to determine if they will be 65 within 6 weeks of the ScreenDate? It is the 6 weeks that is confusing me.

Thanks.
 



Hi,

(Screendt-DOB) computes age in DAYS.

So Screendt + (6 * 7) is the horizon date

If Screendt + (6 * 7) > DateSerial(Year(DOB)+65, Month(DOB), Day(DOB)) then it quallifies.


Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top