Help with date function

C

cinnie

hello

I need help with a function called CompAgeGrp that determine's a student
athlete's competitive age group given his date of birth and the current date.

From Jul 01 to the following Jun 30, the student's competitive age is
defined as his/her age on the January 1 occuring in that span. For example,
consider two students: A was born on Dec 25, 1990, and B was born on Jan 05,
1991. On any date from Jul 01, 2007 to Jun 30, 2008, A's competitive age is
17 because his age on Jan 01, 2008 is 17. B's competitive age during the
same period is only 16.

I'd be grateful for some code to do this.

cinnie
 
K

Ken Snell \(MVP\)

Try this:

Age = DateDiff("yyyy", StudentDateOfBirth, Date())-(Date() >=
DateSerial(Year(Date()), 7, 1) And Date() <= DateSerial(Year(Date()), 12,
31))
 

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