I want to calculate the age in years, months and in days in Access. I have one field for years, one field for months and one field for days. If I enter a date of mortality, it must calculate the age in years, months and days.
Example: DOB is 12-Nov-2000 and Mortality date is 20-Nov-2007 the age must be 7 years, 0 months and 8days.
I tried the following and I got a problem in the days calculation. How can I get the exact age in days? Age in years;
Int(DateDiff("y", '{Demographics.Date_of_Birth}', '{Event_Mortality.EventDate}')/365.25) - working fine Age in months;
Int(DateDiff("m", '{Demographics.Date_of_Birth}', '{Event_Mortality.EventDate}') MOD 12) - working fine Age in days;
Int(DateDiff("y", '{Demographics.Date_of_Birth}', '{Event_Mortality.EventDate}') MOD 30) - does not satisfy the age in days.
1 1525
I want to calculate the age in years, months and in days in Access. I have one field for years, one field for months and one field for days. If I enter a date of mortality, it must calculate the age in years, months and days.
Example: DOB is 12-Nov-2000 and Mortality date is 20-Nov-2007 the age must be 7 years, 0 months and 8days.
I tried the following and I got a problem in the days calculation. How can I get the exact age in days? Age in years;
Int(DateDiff("y", '{Demographics.Date_of_Birth}', '{Event_Mortality.EventDate}')/365.25) - working fine Age in months;
Int(DateDiff("m", '{Demographics.Date_of_Birth}', '{Event_Mortality.EventDate}') MOD 12) - working fine Age in days;
Int(DateDiff("y", '{Demographics.Date_of_Birth}', '{Event_Mortality.EventDate}') MOD 30) - does not satisfy the age in days.
Try this one here
Jim
Sign in to post your reply or Sign up for a free account.
Similar topics
by: androtech |
last post by:
Hello,
I'm looking for a function that returns a date range for a specified week
number of the year.
I'm not able to find functions like this anywhere. Any pointers/help would
be much...
|
by: Rowan |
last post by:
Howdy, I am having some trouble figuring out the best way to approach
my problem with calculations. I think I should use a view but am
having trouble with the structure.
My view needs to...
|
by: Targa |
last post by:
Trying to total some price fields in a form but doesnt work when all the
referenced form fields dont exisit.
This is for an invoice - pulled prom a database and the form doesnt always
contain the...
|
by: lduperval |
last post by:
Hi,
I`m trying to do date calculations in three types of time zones: local,
GMT and specified. The issue I am facing is that I need to be able to
specify a date in the proper time zone, and I`m...
|
by: brian kaufmann |
last post by:
Hi,
I had sent this earlier, and would appreciate any suggestions on this.
I need to make calculations for unemployment rate for three different
data sources (A,B,C) for many countries and age...
|
by: John M |
last post by:
Hi,
I've been coming up against a failure of a report to display the result of a
simple calculation. I have realised that this calculation cannot take place
unless the field I am working on is...
|
by: SJM |
last post by:
There is a database which has combo boxes to allow users to select values
from pre-set lists of common specifications. The form allows users to enter
values that are not in the dropdown lists....
|
by: fredrik.ryde |
last post by:
Hi,
I have a database which contains alot of finacial data. I want to
retreive some data, run som calculations with it, nothing complex just
simple arithmetic.
I wonder if it's faster to let...
|
by: Grubsy4u |
last post by:
Grubsy4u
Newbie
7 Posts October 5th, 2007
11:31 AM
#1
Report calculations
--------------------------------------------------------------------------------
|
by: Catalyst159 |
last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows:
Part A: Maximum FAR and Floor Area:
Part B: Gross Floor Area of...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |