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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

calculate age in query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Grams - 31 Jan 2008 22:13 GMT
In that order - years, months, day
=DateDiff("mmddyyyy",[BirthDate],Now())+(Format([BirthDate],"mmddyyyy")>Format(Now(),"mmddyyyy"))
I got the above from a post but when I try it I get #Error

Help
Janet
Douglas J. Steele - 31 Jan 2008 22:31 GMT
DateDiff will not accept mmddyyyy as a parameter. As well, you don't want to
include yyyy in the Format statements: all you're trying to do is determine
whether or not the birthday has occurred yet this year:

=DateDiff("yyyy",[BirthDate],Now())+(Format([BirthDate],"mmdd")>Format(Now(),"mmdd"))

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> In that order - years, months, days
> =DateDiff("mmddyyyy",[BirthDate],Now())+(Format([BirthDate],"mmddyyyy")>Format(Now(),"mmddyyyy"))
> I got the above from a post but when I try it I get #Error
>
> Help
> Janet
Douglas J. Steele - 31 Jan 2008 22:39 GMT
Sorry, just noticed that in another newsgroup you'd posted using a different
subject (that you wanted the age in years, months and days). See
http://www.accessmvp.com/DJSteele/Diff2Dates.html

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> DateDiff will not accept mmddyyyy as a parameter. As well, you don't want
> to include yyyy in the Format statements: all you're trying to do is
[quoted text clipped - 8 lines]
>> Help
>> Janet
 
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.