Rabu, 21 September 2016

Re: [MS_AccessPros] Age calculation



Use the DateDiff expression or the Age function on the page Duane pointed out.  The CalcAge Sub uses additional arguments to return its calculations, so it won't work called from a query.

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)

On Sep 21, 2016, at 9:16 AM, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

You've missed on basically all cylinders. You are close to getting the age in days, not years. Date() returns today's date. You should also make sure DOB always contains an actual date.  

Most of us use a function of expression like http://access.mvps.org/access/datetime/date0001.htm


On Wed, Sep 21, 2016 at 8:47 AM +0200, "Robin Chapple robinski@westnet.com.au [MS_Access_Professionals]"<MS_Access_Professionals@yahoogroups.com> wrote:

I am using Access 2013.

I need to calculate a person's age, rounded to complete years, as at 'today'.

I tried this:Age:( (Today()-[DOB]) and I see an error message.

What have I missed?

Many thanks,

Robin Chapple

Posted by: Robin Chapple <robinski@westnet.com.au>


Yahoo Groups Links

<*> To visit your group on the web, go to:

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    (Yahoo! ID required)

<*> To change settings via email:

<*> To unsubscribe from this group, send an email to:

<*> Your use of Yahoo Groups is subject to:


Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.



Tidak ada komentar:

Posting Komentar