difference in years between two dates (FileMaker Pro 9)

Please support our MS Access and FileMaker Pro advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Feb 2008
Posts: 1
Reputation: nicolamoore is an unknown quantity at this point 
Solved Threads: 0
nicolamoore nicolamoore is offline Offline
Newbie Poster

difference in years between two dates (FileMaker Pro 9)

 
0
  #1
Feb 23rd, 2008
I need to calculate the approximate current age in years of patients at a clinic.
We don't have the birthday of all the patients, but we know how old they were when then first registered and we know the date they registered.
I am doing a calculation which returns some strange numbers (e.g., 390, 1271, etc.), which obviously aren't correct.
My calculation goes:
CURRENT AGE = AGE AT REGISTRATION + (CURRENT DATE - DATE OF REGISTRATION).
How to I correct this to make it right?
Thanks.

FIXED IT. Divided the (CURRENT DATE - DATE OF REGISTRATION) by 365 and eureka!
Thanks.
Last edited by nicolamoore; Feb 23rd, 2008 at 5:40 pm. Reason: fixed the problem on my own
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,273
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 543
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: difference in years between two dates (FileMaker Pro 9)

 
0
  #2
Feb 24th, 2008
In MS Access VBA you can use the DATEDIFF function
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 195
Reputation: HI2Japan is an unknown quantity at this point 
Solved Threads: 21
HI2Japan HI2Japan is offline Offline
Junior Poster

Re: difference in years between two dates (FileMaker Pro 9)

 
0
  #3
Feb 25th, 2008
You might want to consider 365.25. Keep in mind that every four years there is an extra day
Who was the first person to look at a cow and say, "I think I'll squeeze these dangly things here, and drink whatever comes out!"
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 4
Reputation: Bookman is an unknown quantity at this point 
Solved Threads: 0
Bookman Bookman is offline Offline
Newbie Poster

Re: difference in years between two dates (FileMaker Pro 9)

 
0
  #4
Feb 25th, 2008
I think you could use the Year(date) calculation. Try setting up a new field as a calculation, with the following:
Year (registration date)- Age. That should get you somewhere near a birth year.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the MS Access and FileMaker Pro Forum


Views: 2416 | Replies: 3
Thread Tools Search this Thread



Tag cloud for MS Access and FileMaker Pro
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC