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 / Modules / DAO / VBA / October 2007

Tip: Looking for answers? Try searching our database.

Help with date function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cinnie - 07 Oct 2007 02:14 GMT
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

Signature

cinnie

Ken Snell (MVP) - 07 Oct 2007 02:48 GMT
Try this:

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

Signature

       Ken Snell
<MS ACCESS MVP>

> hello
>
[quoted text clipped - 15 lines]
>
> cinnie
cinnie - 07 Oct 2007 03:26 GMT
I had to subtract 1 from your 'age' function, but now it works fine. Thankyou.
Signature

cinnie

> Try this:
>
[quoted text clipped - 21 lines]
> >
> > cinnie
 
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.