473,405 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

I have a table with person information

3
I have a DoB field and Date_Of_Death field
I want to have an automatic calculation that will show
the age of the death person in another field next to it called Age

Could you please help me with this

Thanx all....Thank you
Jan 11 '17 #1
3 781
Seth Schrock
2,965 Expert 2GB
Use the DateDiff function as the Control Source of your textbox, referencing the two fields in your form for the appropriate information.

Expand|Select|Wrap|Line Numbers
  1. =DateDiff ("yyyy", Forms!Form_Name_Here!DoB, Forms!Form_Name_Here!Date_of_Death)
Jan 11 '17 #2
rzgar
3
Yes it is true
But I want show age (years and month)

please
thank you
Jan 11 '17 #3
Seth Schrock
2,965 Expert 2GB
Then you are going to have to get fancy with the use of the DateAdd() function too. Basically, use the function above to get the number of years, then use that number with the DateAdd function to get what is exactly x years from their death and then use the DateDiff function to get the difference in months from that new date.

Or you can change the above formula to get the number of months, divide it by 12 and then use the Mod function to get the remainder.
Jan 11 '17 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Max | last post by:
Hi, I have the following problem. I want to insert records into one table using the combination of two other tables. Here is a simplified example: Let's say the first table has a column with...
3
by: Oren | last post by:
Hi, Is there a way to hide the connection information of linked SQL Server tables from users? It's easy to open a system table and find the connection info, and if the username and password are...
3
by: Jason Manfield | last post by:
Given a table name (e.g. CUSTOMERS), how do I get column names of the table and the data types of the columns the table has? I am using SQLServer and would like to get that info from my C# code.
4
by: Scot L. Harris | last post by:
Currently using Postgresql 7.2.4-5.80 with php 4.2.2.-8.0.8 on a redhat 8.0 system. I am writing some php scripts where I want to generate a list of the column names in a particular table that...
2
by: iheartvba | last post by:
Hi Guys, This is not a programming question, but there is an alarm ringing in the back of my mind telling me that there is something missing with this table/application I have made. There is a...
0
bilibytes
by: bilibytes | last post by:
hi, I was wondering how to determine whether an information is redundant or not. if you have in a table "Main", the basic information for a thing: thing_id | name | image_id | city_id ok if...
13
by: amit2781 | last post by:
How can we get the table schema information in MYSQL 5.1.34? Like we use in ORACLE to get it as: OCIDescribeAny() // //get the describe handle for the table to be described. OCIAttrGet() ...
0
by: conrad | last post by:
How to find the table dependency information for stored procedures in db2, I want to see which stored proc are link to a table.
1
Seth Schrock
by: Seth Schrock | last post by:
I'm creating a billing database and currently, I'm pulling records from the sales table using the current CustomerID, and two textboxes to give a date range as the criteria for the query. From here,...
3
by: SDaxx | last post by:
I am still learning access, vba and sql and am in need of some assistance. I have a table (tblCommercial) with the following these fields: ReferenceNumber(autonumber) AccountNumber, CompanyName,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.