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 / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Date function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gerald - 20 Apr 2005 13:40 GMT
Dears,

Need help in populating the month and year after entering the date of birth
in a field. Tried below but only gives me the number of years

age = DateDiff("yyyy", [dob], Now()) + _
           Int(Format(Now(), "mmdd") < Format([dob], "mmdd"))

any suggestion is appreciated

Thanks

Nicole
Graham R Seach - 20 Apr 2005 13:57 GMT
Gerald,

To get the number of years:
Age = DateDiff("yyyy",dte1,Date) + (Format(dte1,"mmdd") >
Format(Date,"mmdd"))

To get the number of years, months, days, etc:
http://www.pacificdb.com.au/MVP/Code/Age2.htm
or
http://www.pacificdb.com.au/MVP/Code/Diff2Dates.htm

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

> Dears,
>
[quoted text clipped - 10 lines]
>
> Nicole
 
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.